All Implemented Interfaces:
Constraint
Direct Known Subclasses:
FieldOfMultiple

public class Field extends ConstraintAdapter
Checks if an element has or has not a specific value for a field, or the field value of another element.
Author:
Ozgun Babur
  • Field Details

    • EMPTY

      public static final Object EMPTY
      Possible parameter value indicating user desire the field to be empty.
    • USE_SECOND_ARG

      public static final Object USE_SECOND_ARG
      Possible parameter value indicating the desired value will be given as the second element to the constraint.
  • Constructor Details

    • Field

      public Field(String accessorString, Field.Operation oper, Object value)
      Constructor with accessor string for the field value of the element and the desired value. If the desired value is EMPTY, then emptiness is checked. If it is USE_SECOND_ARG, then the second mapped element is used as the desired value. If a filed of the second element is desired then the other constructor should be used.
      Parameters:
      accessorString - accessor string for the element
      oper - type of check
      value - desired value
    • Field

      public Field(String accessorString1, String accessorString2, Field.Operation oper)
      Constructor with accessor strings for the field value of the element and the desired value that will be reached from the second element.
      Parameters:
      accessorString1 - accessor string for the first element
      accessorString2 - accessor string for the second element
      oper - type of check
  • Method Details

    • satisfies

      public boolean satisfies(Match match, int... ind)
      Checks if the element in the first index has the desired value.
      Specified by:
      satisfies in interface Constraint
      Overrides:
      satisfies in class ConstraintAdapter
      Parameters:
      match - current pattern match
      ind - mapped indices
      Returns:
      true if the filed values contain the desired value, or empty as desired.