Interface CellDefinition<T>
- Type Parameters:
T
- the associated JDK type
- All Known Subinterfaces:
BoolCellDefinition
,BytesCellDefinition
,CharCellDefinition
,ComparableCellDefinition<T>
,DoubleCellDefinition
,IntCellDefinition
,ListCellDefinition
,LongCellDefinition
,MapCellDefinition
,StringCellDefinition
- All Known Implementing Classes:
CellDefinition.Impl
public interface CellDefinition<T>
A
{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.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
static class
Internal interned definition implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CellDefinition<T>
Returns a cell definition with the giventype
andname
.static BoolCellDefinition
defineBool
(String name) Returns aboolean
cell definition with the givenname
.static BytesCellDefinition
defineBytes
(String name) Returns abyte array
cell definition with the givenname
.static CharCellDefinition
defineChar
(String name) Returns acharacter
cell definition with the givenname
.static DoubleCellDefinition
defineDouble
(String name) Returns adouble
cell definition with the givenname
.static IntCellDefinition
Returns aninteger
cell definition with the givenname
.static ListCellDefinition
defineList
(String name) Returns alist
cell definition with the givenname
.static LongCellDefinition
defineLong
(String name) Returns along
cell definition with the givenname
.static MapCellDefinition
Returns amap
cell definition with the givenname
.static StringCellDefinition
defineString
(String name) Returns astring
cell definition with the givenname
.default BuildablePredicate<CellCollection>
exists()
Returns a predicate that tests for the presence of this cell on a record.name()
Returns the name of this definition.Creates a new cell binding this definition to the given value.type()
Returns the type of this definition.default BuildableOptionalFunction<CellCollection,
T> value()
Returns a function that extracts the value of this cell from a record.default BuildableFunction<CellCollection,
T> 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<CellCollection,
T> Returns a function that extracts the value of this cell from a record or throws aNoSuchElementException
if the cell is absent.
-
Method Details
-
name
String name()Returns the name of this definition.- Returns:
- definition name
-
type
Returns the type of this definition.- Returns:
- definition type
-
newCell
Creates a new cell binding this definition to the given value.- Parameters:
value
- value for the cell- Returns:
- a cell
-
value
Returns a function that extracts the value of this cell from a record.- Returns:
- a cell extracting function
-
valueOr
Returns a function that extracts the value of this cell from a record or uses the given default if the cell is absent.- Parameters:
otherwise
- default value for absent cells- Returns:
- a cell extracting function
-
valueOrFail
Returns a function that extracts the value of this cell from a record or throws aNoSuchElementException
if the cell is absent.- Returns:
- a cell extracting function
-
exists
Returns a predicate that tests for the presence of this cell on a record.- Returns:
- a cell existence predicate
-
defineBool
Returns aboolean
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a boolean cell definition
-
defineChar
Returns acharacter
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a character cell definition
-
defineInt
Returns aninteger
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- an integer cell definition
-
defineLong
Returns along
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a long cell definition
-
defineDouble
Returns adouble
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a double cell definition
-
defineString
Returns astring
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a string cell definition
-
defineBytes
Returns abyte array
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a byte array cell definition
-
defineMap
Returns amap
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a map cell definition
-
defineList
Returns alist
cell definition with the givenname
.- Parameters:
name
- cell definition name- Returns:
- a list cell definition
-
define
Returns a cell definition with the giventype
andname
.- Type Parameters:
T
- cell definition JDK type- Parameters:
name
- cell definition nametype
- cell definition type- Returns:
- a cell definition
-