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 classstatic classInternal interned definition implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CellDefinition<T>Returns a cell definition with the giventypeandname.static BoolCellDefinitiondefineBool(String name) Returns abooleancell definition with the givenname.static BytesCellDefinitiondefineBytes(String name) Returns abyte arraycell definition with the givenname.static CharCellDefinitiondefineChar(String name) Returns acharactercell definition with the givenname.static DoubleCellDefinitiondefineDouble(String name) Returns adoublecell definition with the givenname.static IntCellDefinitionReturns anintegercell definition with the givenname.static ListCellDefinitiondefineList(String name) Returns alistcell definition with the givenname.static LongCellDefinitiondefineLong(String name) Returns alongcell definition with the givenname.static MapCellDefinitionReturns amapcell definition with the givenname.static StringCellDefinitiondefineString(String name) Returns astringcell 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 aNoSuchElementExceptionif 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 aNoSuchElementExceptionif 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 abooleancell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a boolean cell definition
-
defineChar
Returns acharactercell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a character cell definition
-
defineInt
Returns anintegercell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- an integer cell definition
-
defineLong
Returns alongcell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a long cell definition
-
defineDouble
Returns adoublecell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a double cell definition
-
defineString
Returns astringcell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a string cell definition
-
defineBytes
Returns abyte arraycell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a byte array cell definition
-
defineMap
Returns amapcell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a map cell definition
-
defineList
Returns alistcell definition with the givenname.- Parameters:
name- cell definition name- Returns:
- a list cell definition
-
define
Returns a cell definition with the giventypeandname.- Type Parameters:
T- cell definition JDK type- Parameters:
name- cell definition nametype- cell definition type- Returns:
- a cell definition
-