public interface TupleType extends DataType
Modifier and Type | Method and Description |
---|---|
default String |
asCql(boolean includeFrozen,
boolean pretty)
Builds an appropriate representation for use in a CQL query.
|
AttachmentPoint |
getAttachmentPoint() |
List<DataType> |
getComponentTypes() |
default int |
getProtocolCode()
The code of the data type in the native protocol specification.
|
TupleValue |
newValue() |
TupleValue |
newValue(Object... values)
Creates a new instance with the specified values for the fields.
|
attach, isDetached
@NonNull TupleValue newValue()
@NonNull TupleValue newValue(@NonNull Object... values)
To encode the values, this method uses the CodecRegistry
that this type is attached
to; it looks for the best codec to handle the target CQL type
and actual runtime type of each value (see CodecRegistry.codecFor(DataType, Object)
).
values
- the values of the tuple's fields. They must be in the same order as the fields in
the tuple's definition. You can specify less values than there are fields (the remaining
ones will be set to NULL), but not more (a runtime exception will be thrown). Individual
values can be null
, but the array itself can't.IllegalArgumentException
- if there are too many values.@NonNull AttachmentPoint getAttachmentPoint()
@NonNull default String asCql(boolean includeFrozen, boolean pretty)
DataType
asCql
in interface DataType
includeFrozen
- whether to include the frozen<...>
keyword if applicable. This
will need to be set depending on where the result is used: for example, CREATE
TABLE
statements use the frozen keyword, whereas it should never appear in CREATE
FUNCTION
.pretty
- whether to pretty-print UDT names (as described in CqlIdentifier.asCql(boolean)
.default int getProtocolCode()
DataType
getProtocolCode
in interface DataType
Copyright © 2017–2024. All rights reserved.