Interface Record<K extends Comparable<K>>

Type Parameters:
K - the key type for the record
All Superinterfaces:
CellCollection, Collection<Cell<?>>, Iterable<Cell<?>>, KeyedCellCollection<K>
All Known Implementing Classes:
AbstractRecord

public interface Record<K extends Comparable<K>> extends KeyedCellCollection<K>
A record is a set of Cells associated with a key. The set of cells forming a record are unique in name. Records are immutable and are the largest atomically modifiable data structure within a dataset. Naturally records should therefore correspond to the natural aggregate or atomic data unit within an application.

The iteration order over Cells in a Record is undefined.

  • Method Details

    • getEqualsPredicate

      default BuildablePredicate<? super Record<K>> getEqualsPredicate()
      Returns a predicate that tests if another Record instance is the same as this one.
      Returns:
      a predicate that tests if another Record instance is the same as this one.
    • equals

      boolean equals(Object o)
      Indicates whether this record is equal to another object.

      A record is equal to:

      • the ABA-safe same record from the same dataset
      • a record from a different dataset with the same contents
      • a keyed-cell collection that is not a record and has the same contents
      A record is not equal to a record from the same dataset with the same contents, that comes from a different point in the history of that dataset.
      Specified by:
      equals in interface Collection<K extends Comparable<K>>
      Specified by:
      equals in interface KeyedCellCollection<K extends Comparable<K>>
      Overrides:
      equals in class Object
      Parameters:
      o - object to be compared for equality with this record
      Returns:
      true if the specified object is equal to this record
      See Also:
    • keyFunction

      static <K extends Comparable<K>> BuildableComparableFunction<KeyedCellCollection<K>,K> keyFunction()
      Returns a function that, given a record, gives the key.
      Type Parameters:
      K - the key type for the record
      Returns:
      a function that, given a record, gives the key.
    • definitions

      static Function<Record<?>,Stream<CellDefinition<?>>> definitions()
      Returns a function that extracts a Stream of cell definitions from a record.
      Returns:
      a function that, extracts a stream of cell definitions from a record
    • schema

      static BuildableFunction<Record<?>,Set<CellDefinition<?>>> schema()
      Returns a function that extracts a Set of cell definitions from a record.
      Returns:
      a function that, extracts a set of cell definitions from a record
    • findFunction

    • emptyRecord

      @Deprecated static <K extends Comparable<K>> Record<K> emptyRecord(K key)
      Returns an empty record instance for the given key.
      Type Parameters:
      K - key type
      Parameters:
      key - record key
      Returns:
      an empty record