Class FieldCount

java.lang.Object
com.northconcepts.datapipeline.filter.Filter
com.northconcepts.datapipeline.filter.FieldCount

public class FieldCount extends Filter
A filter that checks for the total number of fields
  • Constructor Details

    • FieldCount

      public FieldCount(int count)
      Creates a filter that keeps records with exactly count fields.
  • Method Details

    • allow

      public boolean allow(Record record)
      Description copied from class: Filter
      Tests whether a record passes this filter.

      Contract for subclasses (see also docs/authoring/Filter.md):

      • Return true to keep the record.
      • Return false to discard the record (routed to a discard writer if the host FilteringReader is configured with one).
      • Must be a pure decision — do not mutate the record here.
      • Throw DataException only for unrecoverable filter failures; for ordinary "data fails predicate" cases, return false.
      Specified by:
      allow in class Filter
    • toString

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

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: Filter
      Adds this filter's settings to the given exception and returns it; subclasses override it to add their own.
      Overrides:
      addExceptionProperties in class Filter
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

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