Interface LookupTable

All Superinterfaces:
SelfDescribingScalarData

public interface LookupTable extends SelfDescribingScalarData

A LookupTable is a data source that allows some value to be looked up based on a key. It is assumed that the values are looked up with some kind of indexing.

  • Method Details

    • getValueType

      Type getValueType()
      Returns:
      type of values returned by lookups. Note that this shouldn't declare nullable unless keyed values in the table can be null
    • getKeyType

      Type getKeyType()
      Returns:
      type of keys used to lookup values
    • getLookupTableType

      default LookupTableType getLookupTableType()
      Returns:
      A LookupTableType that represents this LookupTable.
    • lookup

      Object lookup(Object key)

      Lookup a value in this table, or null if there is no value for the given key (or null if the key mapped to null)

    • getScalarDataType

      default Type getScalarDataType()
      Description copied from interface: SelfDescribingScalarData

      Returns the RiskScape type that describes this data when extracted from a project and added in to a pipeline as a scalar value.

      It is referred to as the scalar type to make it clear it's not the same as the Type of the data contained within it, e.g. the Struct type of the relation (non-scalar) vs RelationType that represents the relation itself (scalar).

      Specified by:
      getScalarDataType in interface SelfDescribingScalarData