Class ValueMatch<T>

java.lang.Object
com.northconcepts.datapipeline.filter.FieldFilterRule
com.northconcepts.datapipeline.filter.rule.ValueMatch<T>
All Implemented Interfaces:
Cloneable

public class ValueMatch<T> extends FieldFilterRule implements Cloneable
A FieldFilterRule that allows fields whose value equals one of its values; values are compared with equals, so their Java types must match (for example 1 and 1L differ).
  • Constructor Details

    • ValueMatch

      public ValueMatch()
    • ValueMatch

      public ValueMatch(T... array)
    • ValueMatch

      public ValueMatch(Collection<?> collection)
  • Method Details

    • clone

      public ValueMatch<T> clone()
      Overrides:
      clone in class Object
    • getCount

      public int getCount()
    • get

      public T get(int index)
    • getValues

      public ArrayList<T> getValues()
      Returns the live list of values to match; changes to it affect this rule.
    • allow

      public boolean allow(Field field)
      Description copied from class: FieldFilterRule
      Returns true if the given field satisfies this rule; called by FieldFilter with each field it checks.
      Specified by:
      allow in class FieldFilterRule
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • add

      public ValueMatch<T> add(T... values)
    • add

      public ValueMatch<T> add(DataReader source, String fieldName)
      Adds the named field's value from every record in source, which is opened, read to the end and closed here.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object