@InterfaceAudience.Public @InterfaceStability.Evolving public static class ColumnSchema.ColumnSchemaBuilder extends Object
Constructor and Description |
---|
ColumnSchemaBuilder(ColumnSchema that)
Constructor to copy an existing columnSchema
|
ColumnSchemaBuilder(String name,
Type type)
Constructor for the required parameters.
|
Modifier and Type | Method and Description |
---|---|
ColumnSchema |
build()
Builds a
ColumnSchema using the passed parameters. |
ColumnSchema.ColumnSchemaBuilder |
comment(String comment)
Set the comment for this column.
|
ColumnSchema.ColumnSchemaBuilder |
compressionAlgorithm(ColumnSchema.CompressionAlgorithm compressionAlgorithm)
Set the compression algorithm for this column.
|
ColumnSchema.ColumnSchemaBuilder |
defaultValue(Object defaultValue)
Sets the default value that will be read from the column.
|
ColumnSchema.ColumnSchemaBuilder |
desiredBlockSize(int desiredBlockSize)
Set the desired block size for this column.
|
ColumnSchema.ColumnSchemaBuilder |
encoding(ColumnSchema.Encoding encoding)
Set the block encoding for this column.
|
ColumnSchema.ColumnSchemaBuilder |
immutable(boolean immutable)
Marks the column as immutable or not.
|
ColumnSchema.ColumnSchemaBuilder |
key(boolean key)
Sets if the column is part of the row key.
|
ColumnSchema.ColumnSchemaBuilder |
nonUniqueKey(boolean key)
Sets if the column is part of the row non unique key.
|
ColumnSchema.ColumnSchemaBuilder |
nullable(boolean nullable)
Marks the column as allowing null values.
|
ColumnSchema.ColumnSchemaBuilder |
typeAttributes(ColumnTypeAttributes typeAttributes)
Set the column type attributes for this column.
|
public ColumnSchemaBuilder(String name, Type type)
name
- column's nametype
- column's typeIllegalArgumentException
- if the column's name equals the reserved
auto-incrementing column namepublic ColumnSchemaBuilder(ColumnSchema that)
that
- the columnSchema to copypublic ColumnSchema.ColumnSchemaBuilder key(boolean key)
key
- a boolean that indicates if the column is part of the keypublic ColumnSchema.ColumnSchemaBuilder nonUniqueKey(boolean key)
key
- a boolean that indicates if the column is a part of the non unique keypublic ColumnSchema.ColumnSchemaBuilder nullable(boolean nullable)
NOTE: the "not-nullable-by-default" behavior here differs from
the equivalent API in the Python and C++ clients. It also differs from the
standard behavior of SQL CREATE TABLE
statements. It is
recommended to always specify nullability explicitly using this API
in order to avoid confusion.
nullable
- a boolean that indicates if the column allows null valuespublic ColumnSchema.ColumnSchemaBuilder immutable(boolean immutable)
immutable
- a boolean that indicates if the column is immutablepublic ColumnSchema.ColumnSchemaBuilder defaultValue(Object defaultValue)
defaultValue
- a Java object representation of the default value that's readpublic ColumnSchema.ColumnSchemaBuilder desiredBlockSize(int desiredBlockSize)
desiredBlockSize
- the desired block size, in bytespublic ColumnSchema.ColumnSchemaBuilder encoding(ColumnSchema.Encoding encoding)
public ColumnSchema.ColumnSchemaBuilder compressionAlgorithm(ColumnSchema.CompressionAlgorithm compressionAlgorithm)
public ColumnSchema.ColumnSchemaBuilder typeAttributes(ColumnTypeAttributes typeAttributes)
public ColumnSchema.ColumnSchemaBuilder comment(String comment)
public ColumnSchema build()
ColumnSchema
using the passed parameters.ColumnSchema