java.lang.Object
com.northconcepts.datapipeline.transform.lookup.Lookup
com.northconcepts.datapipeline.transform.lookup.BasicLookup

public class BasicLookup extends Lookup
An in-memory Lookup filled with add calls, where each key maps to one or more result records.
  • Constructor Details

    • BasicLookup

      public BasicLookup(FieldList resultFieldNames)
      Creates an empty lookup whose result records have the given fields, filled in order from the values passed to add.
  • Method Details

    • get

      public RecordList get(Object... keys)
      Description copied from class: Lookup
      Returns the records that match the supplied composite lookup key.

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

      • Called once per source record by LookupTransformer; keep it fast.
      • Return an empty RecordList when no match is found. null is also tolerated by LookupTransformer for backward compatibility, but new code should prefer an empty list for clearer semantics.
      • Do not mutate the supplied keys; they are owned by the caller.
      Specified by:
      get in class Lookup
    • add

      public BasicLookup add(Object key, Object value)
      Adds a result record for the key with value as its only field; requires exactly one result field.
    • add

      public BasicLookup add(Object key, Object[] values)
      Adds a result record for the key with one value per result field, in order.
    • add

      public BasicLookup add(Object[] key, Object value)
      Adds a result record for the composite key with value as its only field; requires exactly one result field.
    • add

      public BasicLookup add(Object[] key, Object[] values)
      Adds a result record for the composite key with one value per result field, in order.
    • toString

      public String toString()
      Overrides:
      toString in class Object