Class KeyValueQualifier

java.lang.Object
xal.tools.data.KeyValueQualifier
All Implemented Interfaces:
Qualifier

public class KeyValueQualifier extends Object implements Qualifier
Check that a record's value corresponding to the specified key compares to the specified value based on the comparison type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    comparison operation - record's value corresponding to qualifier's key must be equal to the qualifier's value
    static final int
    comparison operation - record's value corresponding to qualifier's key must be greater than the qualifier's value
    static final int
    comparison operation - record's value corresponding to qualifier's key must be greater than or equal to the qualifier's value
    static final int
    comparison operation - record's value corresponding to qualifier's key must be less than the qualifier's value
    static final int
    comparison operation - record's value corresponding to qualifier's key must be less than or equal to the qualifier's value
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor in which the default comparison operation (equality) is used.
    KeyValueQualifier(String key, Comparable<Object> value, int operation)
    Primary Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    matches(Object object)
    Determine if the specified object is a match to this qualifier's criteria.
    Get a string representation of this instance

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • COMPARE_LESS_THAN

      public static final int COMPARE_LESS_THAN
      comparison operation - record's value corresponding to qualifier's key must be less than the qualifier's value
      See Also:
    • COMPARE_LESS_THAN_OR_EQUALS

      public static final int COMPARE_LESS_THAN_OR_EQUALS
      comparison operation - record's value corresponding to qualifier's key must be less than or equal to the qualifier's value
      See Also:
    • COMPARE_EQUALS

      public static final int COMPARE_EQUALS
      comparison operation - record's value corresponding to qualifier's key must be equal to the qualifier's value
      See Also:
    • COMPARE_GREATER_THAN_OR_EQUALS

      public static final int COMPARE_GREATER_THAN_OR_EQUALS
      comparison operation - record's value corresponding to qualifier's key must be greater than or equal to the qualifier's value
      See Also:
    • COMPARE_GREATER_THAN

      public static final int COMPARE_GREATER_THAN
      comparison operation - record's value corresponding to qualifier's key must be greater than the qualifier's value
      See Also:
  • Constructor Details

    • KeyValueQualifier

      public KeyValueQualifier(String key, Comparable<Object> value, int operation)
      Primary Constructor
      Parameters:
      key - the key for which the record's value is fetched
      value - the value with which to the compare the record's value for the specified key
      operation - the code corresponding to the comparison operation
    • KeyValueQualifier

      public KeyValueQualifier(String key, Comparable value)
      Constructor in which the default comparison operation (equality) is used.
      Parameters:
      key - the key for which the record's value is fetched
      value - the value with which to the compare the record's value for the specified key
  • Method Details

    • matches

      public boolean matches(Object object)
      Determine if the specified object is a match to this qualifier's criteria. The object must implement the KeyedRecord interface and its value corresponding to _key must implement the java.util.Comparable interface. See java.util.Comparable for more information.
      Specified by:
      matches in interface Qualifier
      Parameters:
      object - the object to test for matching
      Returns:
      true if the object matches the criteria and false if not.
      Throws:
      ClassCastException - if the object does not implement the Comparable interface
    • toString

      public String toString()
      Get a string representation of this instance
      Overrides:
      toString in class Object
      Returns:
      a string representation of this instance.