Class FieldExists

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

public class FieldExists extends Filter
A filter that checks if all the specified field exists. See FieldPath for supported field name expressions.
  • Constructor Details

    • FieldExists

      public FieldExists(String... names)
      Creates a filter that keeps records containing all of the given fields; at least one name is required.
    • FieldExists

      public FieldExists(String name)
  • Method Details

    • getNames

      public FieldPath[] getNames()
    • getName

      public String getName()
      Returns the field name when this filter checks exactly one field, otherwise null.
    • 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