Class ImmutableColumn
java.lang.Object
io.stargate.sgv2.api.common.cql.builder.ImmutableColumn
- All Implemented Interfaces:
Column
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableColumn
extends Object
implements Column
Immutable implementation of
Column.
Use the builder to create immutable instances:
ImmutableColumn.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.stargate.sgv2.api.common.cql.builder.Column
Column.Kind, Column.Order -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableColumn.Builderbuilder()Creates a builder forImmutableColumn.static ImmutableColumnCreates an immutable copy of aColumnvalue.cqlName()booleanThis instance is equal to all instances ofImmutableColumnthat have equal attribute values.inthashCode()Returns a precomputed-on-construction hash code from attributes:name,type,kind,order.kind()name()order()toString()Prints the immutable valueColumnwith attribute values.type()TODO do we ever need a more structured representation?final ImmutableColumnwithKind(Column.Kind value) Copy the current immutable object by setting a value for thekindattribute.final ImmutableColumnCopy the current immutable object by setting a value for thenameattribute.final ImmutableColumnwithOrder(Column.Order value) Copy the current immutable object by setting a value for theorderattribute.final ImmutableColumnCopy the current immutable object by setting a value for thetypeattribute.
-
Method Details
-
name
-
type
TODO do we ever need a more structured representation? -
kind
-
order
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
withKind
Copy the current immutable object by setting a value for thekindattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for kind (can benull)- Returns:
- A modified copy of the
thisobject
-
withOrder
Copy the current immutable object by setting a value for theorderattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for order (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableColumnthat have equal attribute values. -
hashCode
public int hashCode()Returns a precomputed-on-construction hash code from attributes:name,type,kind,order. -
toString
Prints the immutable valueColumnwith attribute values. -
cqlName
Returns a lazily initialized value of the
cqlNameattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again. -
copyOf
Creates an immutable copy of aColumnvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Column instance
-
builder
Creates a builder forImmutableColumn.ImmutableColumn.builder() .name(String) // requiredname.type(String | null) // nullabletype.kind(io.stargate.sgv2.api.common.cql.builder.Column.Kind | null) // nullablekind.order(io.stargate.sgv2.api.common.cql.builder.Column.Order | null) // nullableorder.build();- Returns:
- A new ImmutableColumn builder
-