java.lang.Object
java.lang.Enum<ErrorCode>
es.kukenan.smartfi.common.service.validation.annotations.ErrorCode
All Implemented Interfaces:
Serializable, Comparable<ErrorCode>, Constable

public enum ErrorCode extends Enum<ErrorCode>
Error codes for known common validation constraint violations.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Generic invalid value error code.
    A field that should be null (or not be present) is not null.
    Required field not present.
    Required field is empty (null or empty string, map, collection...).
    Required field (string) is empty or does not contain, at least, one non-blank character.
    Error code for a field that must be a number whose value must be lower or equal to the specified maximum.
    Error code for a field that must be a number whose value must be higher or equal to the specified maximum.
    Error code for a field that must be in a specific range.
    Error code for a field that must be a number whose value must be lower or equal to the specified maximum.
    Error code for a field that must be a number whose value must be higher or equal to the specified maximum.
    Error code for a field that must be between the specified boundaries (included).
    Error code for a field that must be an instant, date or time in the future.
    Error code for a field that must be an instant, date or time in the present or future.
    Error code for a field that must be an instant, date or time in the past.
    Error code for a field that must be an instant, date or time in the past.
    Error code for a field that must be a well-formed email address.
    Error code for a field which value should match a regular expression.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Class<? extends Annotation>
    The constrating Annotation for the given error code.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    ErrorCode(Class<? extends Annotation> constraint)
    Enumeration entry constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends Annotation>
    ErrorCode
    forConstraint(T constraint)
    Get the corresponding error code for a constraint violation.
    static ErrorCode
    Returns the enum constant of this class with the specified name.
    static ErrorCode[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • V4000000

      public static final ErrorCode V4000000
      Generic invalid value error code.
    • V4000001

      public static final ErrorCode V4000001
      A field that should be null (or not be present) is not null. See Null.
    • V4000002

      public static final ErrorCode V4000002
      Required field not present. See Null. See NotNull.
    • V4000003

      public static final ErrorCode V4000003
      Required field is empty (null or empty string, map, collection...). See NotEmpty.
    • V4000004

      public static final ErrorCode V4000004
      Required field (string) is empty or does not contain, at least, one non-blank character. See NotBlank.
    • V4000005

      public static final ErrorCode V4000005
      Error code for a field that must be a number whose value must be lower or equal to the specified maximum. See DecimalMax.
    • V4000006

      public static final ErrorCode V4000006
      Error code for a field that must be a number whose value must be higher or equal to the specified maximum. See DecimalMin.
    • V4000007

      public static final ErrorCode V4000007
      Error code for a field that must be in a specific range. See Digits.
    • V4000008

      public static final ErrorCode V4000008
      Error code for a field that must be a number whose value must be lower or equal to the specified maximum. See Max.
    • V4000009

      public static final ErrorCode V4000009
      Error code for a field that must be a number whose value must be higher or equal to the specified maximum. See Min.
    • V4000010

      public static final ErrorCode V4000010
      Error code for a field that must be between the specified boundaries (included). See Size.
    • V4000011

      public static final ErrorCode V4000011
      Error code for a field that must be an instant, date or time in the future. See Future.
    • V4000012

      public static final ErrorCode V4000012
      Error code for a field that must be an instant, date or time in the present or future. See FutureOrPresent.
    • V4000013

      public static final ErrorCode V4000013
      Error code for a field that must be an instant, date or time in the past. See Past.
    • V4000014

      public static final ErrorCode V4000014
      Error code for a field that must be an instant, date or time in the past. See Past.
    • V4000015

      public static final ErrorCode V4000015
      Error code for a field that must be a well-formed email address. See Email.
    • V4000016

      public static final ErrorCode V4000016
      Error code for a field which value should match a regular expression. See Pattern.
  • Field Details

  • Constructor Details

    • ErrorCode

      private ErrorCode(Class<? extends Annotation> constraint)
      Enumeration entry constructor.
      Parameters:
      constraint - the constrating Annotation for the given error code.
  • Method Details

    • values

      public static ErrorCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ErrorCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • forConstraint

      public static <T extends Annotation> ErrorCode forConstraint(T constraint)
      Get the corresponding error code for a constraint violation.
      Type Parameters:
      T - the constraint annotation type.
      Parameters:
      constraint - the violated constraint.
      Returns:
      the corresponding error code for the given constraint. If not found, V4000000 will be returnes.