Class SelectFields

java.lang.Object
com.northconcepts.datapipeline.transform.Transformer
com.northconcepts.datapipeline.transform.SelectFields
Direct Known Subclasses:
IncludeFields

public class SelectFields extends Transformer
Select and arrange fields according to the supplied field names -- like an SQL SELECT statement. See FieldPath for supported field name expressions.
  • Constructor Details

    • SelectFields

      public SelectFields(Collection<String> fieldNames)
    • SelectFields

      public SelectFields(String... fieldNames)
  • Method Details

    • isLenient

      public boolean isLenient()
      Indicates if fields missing from a record are skipped instead of causing an exception (default is false).
    • setLenient

      public SelectFields setLenient(boolean lenient)
      Indicates if fields missing from a record are skipped instead of causing an exception (default is false).
    • getFields

      public FieldList getFields()
    • add

      public SelectFields add(Collection<String> fieldNames)
      Appends fields to select, placed after those already added; a null collection is ignored.
    • add

      public SelectFields add(String... fieldNames)
      Appends fields to select, placed after those already added.
    • transform

      public boolean transform(Record record) throws Throwable
      Description copied from class: Transformer
      Applies this transformer to a record on its way through a TransformingReader or TransformingWriter.

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

      • Mutate record in place as needed.
      • Return true to keep the record in the pipeline.
      • Return false to drop the record (the host routes it to a discard writer if one is configured, otherwise it disappears).
      • Throw to fail (or route to a discard writer, depending on host configuration).
      • Do not call incrementRecordCount() on the host endpoint; the host handles it.
      Specified by:
      transform in class Transformer
      Throws:
      Throwable
    • toString

      public String toString()
      Overrides:
      toString in class Object