Package app.babylon.table.column
Interface ColumnObject.Builder<T>
- Type Parameters:
T- the value type produced by the builder
- All Superinterfaces:
Column.Builder
- All Known Subinterfaces:
ColumnCategorical.Builder<T>
- Enclosing interface:
ColumnObject<T>
Builder for nullable object columns.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ColumnObject.Builder<T> add(Sentence.ParseMode parseMode, CharSequence chars, int start, int end) Appends a value directly from a character slice using the supplied parse mode.default ColumnObject.Builder<T> add(CharSequence chars, int start, int end) Appends a value directly from a character slice using exact parsing.Appends a value to the column.default ColumnObject.Builder<T> addNull()Appends an unset row.build()Materialises the current builder contents as an immutable column.buildAs(Column.Type transformedType) Builds a column by parsing this builder's source values as the supplied target type.getName()Returns the name that will be assigned to the built column.getType()Returns the object column type produced by this builder.Methods inherited from interface app.babylon.table.column.Column.Builder
add, add
-
Method Details
-
getName
ColumnName getName()Description copied from interface:Column.BuilderReturns the name that will be assigned to the built column.- Specified by:
getNamein interfaceColumn.Builder- Returns:
- the target column name
-
getType
Column.Type getType()Returns the object column type produced by this builder.- Returns:
- builder type
-
add
Appends a value to the column.- Parameters:
x- the value to append, which may benull- Returns:
- this builder
-
add
Description copied from interface:Column.BuilderAppends a value directly from a character slice using exact parsing.- Specified by:
addin interfaceColumn.Builder- Parameters:
chars- the source textstart- the start indexend- one past the last character in the slice- Returns:
- this builder
-
add
default ColumnObject.Builder<T> add(Sentence.ParseMode parseMode, CharSequence chars, int start, int end) Description copied from interface:Column.BuilderAppends a value directly from a character slice using the supplied parse mode.- Specified by:
addin interfaceColumn.Builder- Parameters:
parseMode- sentence parse mode, ornullfor exact parsingchars- the source textstart- the start indexend- one past the last character in the slice- Returns:
- this builder
-
build
ColumnObject<T> build()Description copied from interface:Column.BuilderMaterialises the current builder contents as an immutable column.- Specified by:
buildin interfaceColumn.Builder- Returns:
- the built column
-
buildAs
Builds a column by parsing this builder's source values as the supplied target type. The returned column followstransformedType, not necessarily this object builder's interface. For example, a string-backed object builder may produce a primitive column when the target type is primitive. If the supplied target type is the same as the builder type, this behaves likebuild()and returns the object column directly.- Parameters:
transformedType- the target column type- Returns:
- an immutable column whose logical type is
transformedType
-
addNull
Appends an unset row.- Specified by:
addNullin interfaceColumn.Builder- Returns:
- this builder
-