Annotation Interface OneOf


Checks to see that the value is one of a set of elements.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The set of valid values.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    The groups the constraint belongs to.
    boolean
    Whether to ignore case.
    boolean
    Whether to ignore leading and trailing whitespace.
    The validation message for this constraint.
    Class<? extends jakarta.validation.Payload>[]
    The payloads of this constraint.
  • Element Details

    • value

      String[] value
      The set of valid values.
      Returns:
      an array containing the valid string values
    • message

      String message
      The validation message for this constraint.
      Returns:
      the message
      Default:
      "must be one of {value}"
    • groups

      Class<?>[] groups
      The groups the constraint belongs to.
      Returns:
      an array of classes representing the groups
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      The payloads of this constraint.
      Returns:
      the array of payload classes
      Default:
      {}
    • ignoreCase

      boolean ignoreCase
      Whether to ignore case.
      Returns:
      if the case should be ignored
      Default:
      false
    • ignoreWhitespace

      boolean ignoreWhitespace
      Whether to ignore leading and trailing whitespace.
      Returns:
      if leading and trailing whitespaces should be ignored
      Default:
      false