Enum Class RuntimeContract

java.lang.Object
java.lang.Enum<RuntimeContract>
media.barney.contract.runtime.RuntimeContract
All Implemented Interfaces:
Serializable, Comparable<RuntimeContract>, Constable

@API(status=MAINTAINED) public enum RuntimeContract extends Enum<RuntimeContract>
Contract kinds used by generated enforcement code.

Each value maps a built-in contract annotation to the corresponding runtime evaluation rule. This enum is part of the generated-code bridge; application code normally uses media.barney.contract.Contract annotations directly.

  • Enum Constant Details

    • NOT_EMPTY

      public static final RuntimeContract NOT_EMPTY
      Non-empty contract for character sequences, collections, maps, and arrays.
    • NOT_BLANK

      public static final RuntimeContract NOT_BLANK
      Non-blank contract for character sequences.
    • POSITIVE

      public static final RuntimeContract POSITIVE
      Numeric contract requiring a value greater than zero.
    • NEGATIVE

      public static final RuntimeContract NEGATIVE
      Numeric contract requiring a value less than zero.
    • NON_NEGATIVE

      public static final RuntimeContract NON_NEGATIVE
      Numeric contract requiring a value greater than or equal to zero.
    • NON_POSITIVE

      public static final RuntimeContract NON_POSITIVE
      Numeric contract requiring a value less than or equal to zero.
    • IN_RANGE

      public static final RuntimeContract IN_RANGE
      Numeric contract requiring a value within configured bounds.
    • SIZE

      public static final RuntimeContract SIZE
      Size contract for character sequences, collections, maps, and arrays.
    • PATTERN

      public static final RuntimeContract PATTERN
      Pattern contract requiring a character sequence to fully match a regular expression.
  • Method Details

    • values

      public static RuntimeContract[] 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 RuntimeContract 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