java.lang.Object
io.github.venkateshamurthy.enums.DynamicEnum<Faults>
io.github.venkateshamurthy.enums.examples.Faults
All Implemented Interfaces:
FaultCode

public final class Faults extends DynamicEnum<Faults> implements FaultCode
Faults is an example DynamicEnum for experimental purpose that could potentially resolve the serialization issues observed in serializing/de-serializing newer instances (This is an issue with static Enum which i am to trying address)
  • Field Details

    • UNKNOWN

      public static final Faults UNKNOWN
      Unknown error. The field name and the name() should match to see this close to an enum.
    • FILE_LOCKED_ERR

      public static final Faults FILE_LOCKED_ERR
      File already locked fault with a corresponding HttpStatus.LOCKED.
    • FILE_LNCK_ERR

      public static final Faults FILE_LNCK_ERR
      File checksum error with a corresponding HttpStatus.UNPROCESSABLE_ENTITY.
    • VALIDATION_ERR

      public static final Faults VALIDATION_ERR
      General validation error with a corresponding HttpStatus.BAD_REQUEST.
    • SERVER_ERR

      public static final Faults SERVER_ERR
      Server error with a corresponding HttpStatus.INTERNAL_SERVER_ERROR
  • Method Details

    • name

      public String name()
      Gets the name.
      Specified by:
      name in interface FaultCode
      Overrides:
      name in class DynamicEnum<Faults>
      Returns:
      name
    • values

      public static Faults[] values()
      Get an array of Fault instances created in this JVM.
      Returns:
      array of Faults
    • getDefaultMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getDefaultMapper()
      Get a ObjectMapper with any configuration
      Returns:
      ObjectMapper
    • valueOf

      public static Faults valueOf(String name)
      A valueOf function getting the Faults corresponding to name passed
      Parameters:
      name - of Faults
      Returns:
      Faults