Annotation Interface ConditionalNotEmpty


Checks if specified field is not empty only when conditionField has specified value.
See Also:
  • Element Details

    • field

      String[] field
      Validated field.
      Returns:
      field name
    • conditionField

      String conditionField
      Conditional field. Validation check is executed only when the value of this field is equal to the value which fieldWhichHoldsConditionalValue holds.
      Returns:
      condition field name
    • conditionValue

      String[] conditionValue
      Validation check is executed only when the value conditionField holds is equal to to it.

      You can use this value when the datatype of conditionField is String. Otherwise you should use fieldWhichHoldsConditionalValue.

      Multiple values can be set to the parameter. In that case validation check is executed when one of the values are equal to the value of conditionField.

      Returns:
      value
      Default:
      {"[null]"}
    • conditionValueIsEmpty

      boolean conditionValueIsEmpty
      Validation check is executed only when it's true and the value conditionField holds is empty.
      Returns:
      boolean
      Default:
      false
    • conditionValueIsNotEmpty

      boolean conditionValueIsNotEmpty
      Validation check is executed only when it's true and the value conditionField holds is not empty.
      Returns:
      boolean
      Default:
      false
    • fieldHoldingConditionValue

      String fieldHoldingConditionValue
      See conditionField.

      Originally The datatype of a parameter of annotation can only be String and primitive datatypes. It cannot be Object.

      Returns:
      value
      Default:
      "[null]"
    • emptyForOtherValues

      boolean emptyForOtherValues
      Decides whether validation check is executed when the value of conditionField is not equal to the specified value.
      Returns:
      boolean
      Default:
      false
    • fieldHoldingConditionValueDisplayName

      String fieldHoldingConditionValueDisplayName
      Specifies a field which holds the display name of condition value.

      It can be an array datatype which has multiple values.
      When the value is new String[] {""}, the condionValue specified is displayed as a part of an error message.

      Returns:
      String
      Default:
      ""
    • message

      String message
      Returns message ID.
      Returns:
      message ID
      Default:
      "{jp.ecuacion.validation.constraints.ConditionalNotEmpty.message}"
    • groups

      Class<?>[] groups
      Returns groups.
      Returns:
      groups
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      Returns payload.
      Returns:
      payload
      Default:
      {}