Class KeyValuePatternQualifier

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

public class KeyValuePatternQualifier extends Object implements Qualifier
Qualifier to filter (based on the specified pattern) a record's value associated with a specified key.
  • Constructor Details

    • KeyValuePatternQualifier

      public KeyValuePatternQualifier(String key, String regularExpression, int flags)
      Primary constructor
      Parameters:
      key - the key identifying the value to test from the record
      regularExpression - the regular expression used for matching
      flags - pattern flags
    • KeyValuePatternQualifier

      public KeyValuePatternQualifier(String key, String regularExpression)
      Constructor with the default pattern flags.
      Parameters:
      key - the key identifying the value to test from the record
      regularExpression - the regular expression used for matching
  • Method Details

    • matches

      public boolean matches(Object object)
      Determine if the specified record's value associated with this qualifier's key is a match to this qualifier's pattern. The value corresponding to this qualifier's key must be a java.lang.CharSequence.
      Specified by:
      matches in interface Qualifier
      Parameters:
      object - The object to test for matching. The object must be a keyed record.
      Returns:
      true if the object matches the criteria and false if not.
    • toString

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