T
- the associated JDK typepublic interface CellDefinition<T>
{name, type}
tuple that identifies a cell. Cells within a record
must have definitions with unique names. Cells however are not considered
related for the purposes of cell to cell comparison when performing
computation operations unless the two cell definitions are identical in both
name and type.Modifier and Type | Interface and Description |
---|---|
static class |
CellDefinition.CellImpl<T> |
static class |
CellDefinition.Impl<T>
Internal interned definition implementation.
|
Modifier and Type | Method and Description |
---|---|
static <T> CellDefinition<T> |
define(java.lang.String name,
Type<T> type)
Returns a cell definition with the given
type and name . |
static BoolCellDefinition |
defineBool(java.lang.String name)
Returns a
boolean cell definition with the given name . |
static BytesCellDefinition |
defineBytes(java.lang.String name)
Returns a
byte array cell definition with the given name . |
static CharCellDefinition |
defineChar(java.lang.String name)
Returns a
character cell definition with the given name . |
static DoubleCellDefinition |
defineDouble(java.lang.String name)
Returns a
double cell definition with the given name . |
static IntCellDefinition |
defineInt(java.lang.String name)
Returns an
integer cell definition with the given name . |
static LongCellDefinition |
defineLong(java.lang.String name)
Returns a
long cell definition with the given name . |
static StringCellDefinition |
defineString(java.lang.String name)
Returns a
string cell definition with the given name . |
default BuildablePredicate<Record<?>> |
exists()
Returns a predicate that tests for the presence of this cell on a record.
|
java.lang.String |
name()
Returns the name of this definition.
|
Cell<T> |
newCell(T value)
Creates a new cell binding this definition to the given value.
|
Type<T> |
type()
Returns the type of this definition.
|
default BuildableOptionalFunction<Record<?>,T> |
value()
Returns a function that extracts the value of this cell from a record.
|
default BuildableFunction<Record<?>,T> |
valueOr(T otherwise)
Returns a function that extracts the value of this cell from a record or
uses the given default if the cell is absent.
|
default BuildableFunction<Record<?>,T> |
valueOrFail()
Returns a function that extracts the value of this cell from a record or
throws a
NoSuchElementException if the cell is absent. |
java.lang.String name()
Cell<T> newCell(T value)
value
- value for the celldefault BuildableOptionalFunction<Record<?>,T> value()
default BuildableFunction<Record<?>,T> valueOr(T otherwise)
otherwise
- default value for absent cellsdefault BuildableFunction<Record<?>,T> valueOrFail()
NoSuchElementException
if the cell is absent.default BuildablePredicate<Record<?>> exists()
static BoolCellDefinition defineBool(java.lang.String name)
boolean
cell definition with the given name
.name
- cell definition namestatic CharCellDefinition defineChar(java.lang.String name)
character
cell definition with the given name
.name
- cell definition namestatic IntCellDefinition defineInt(java.lang.String name)
integer
cell definition with the given name
.name
- cell definition namestatic LongCellDefinition defineLong(java.lang.String name)
long
cell definition with the given name
.name
- cell definition namestatic DoubleCellDefinition defineDouble(java.lang.String name)
double
cell definition with the given name
.name
- cell definition namestatic StringCellDefinition defineString(java.lang.String name)
string
cell definition with the given name
.name
- cell definition namestatic BytesCellDefinition defineBytes(java.lang.String name)
byte array
cell definition with the given name
.name
- cell definition namestatic <T> CellDefinition<T> define(java.lang.String name, Type<T> type)
type
and name
.T
- cell definition JDK typename
- cell definition nametype
- cell definition type