Class SetBatchSequenceNumberField

java.lang.Object
com.northconcepts.datapipeline.transform.Transformer
com.northconcepts.datapipeline.transform.SetBatchSequenceNumberField

public class SetBatchSequenceNumberField extends Transformer
Adds a sequence (auto increment) field that is incremented with the step value when the value(s) in the specified watch fields differs from the previous record. If no watch fields are specified, the entire record is watched for change. See FieldPath for supported field name expressions.
  • Constructor Details

    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, long start, long step, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step, overwriting any existing value.
    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, double start, double step, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step, overwriting any existing value.
    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, BigDecimal start, BigDecimal step, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step, overwriting any existing value.
    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, BigInteger start, BigInteger step, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step, overwriting any existing value.
    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, long start, long step, boolean overwrite, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step; when overwrite is false, records that already have the field keep their value.
    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, double start, double step, boolean overwrite, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step; when overwrite is false, records that already have the field keep their value.
    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, BigDecimal start, BigDecimal step, boolean overwrite, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step; when overwrite is false, records that already have the field keep their value.
    • SetBatchSequenceNumberField

      public SetBatchSequenceNumberField(String name, BigInteger start, BigInteger step, boolean overwrite, String... watchFields)
      Creates a transformer that numbers batches from start in steps of step; when overwrite is false, records that already have the field keep their value.
  • Method Details

    • getName

      public String getName()
    • getStart

      public Number getStart()
    • getStep

      public Number getStep()
    • getOverwrite

      public boolean getOverwrite()
    • 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