Package com.databricks.jdbc.api.impl
Class ImmutableSqlParameter
- java.lang.Object
-
- com.databricks.jdbc.api.impl.ImmutableSqlParameter
-
- All Implemented Interfaces:
SqlParameter
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableSqlParameter extends Object implements SqlParameter
Immutable implementation ofSqlParameter.Use the builder to create immutable instances:
ImmutableSqlParameter.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableSqlParameter.BuilderBuilds instances of typeImmutableSqlParameter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableSqlParameter.Builderbuilder()Creates a builder forImmutableSqlParameter.intcardinal()static ImmutableSqlParametercopyOf(SqlParameter instance)Creates an immutable copy of aSqlParametervalue.booleanequals(Object another)This instance is equal to all instances ofImmutableSqlParameterthat have equal attribute values.inthashCode()Computes a hash code from attributes:value,type,cardinal.StringtoString()Prints the immutable valueSqlParameterwith attribute values.ColumnInfoTypeNametype()Objectvalue()ImmutableSqlParameterwithCardinal(int value)Copy the current immutable object by setting a value for thecardinalattribute.ImmutableSqlParameterwithType(ColumnInfoTypeName value)Copy the current immutable object by setting a value for thetypeattribute.ImmutableSqlParameterwithValue(Object value)Copy the current immutable object by setting a value for thevalueattribute.
-
-
-
Method Detail
-
value
@Nullable public Object value()
- Specified by:
valuein interfaceSqlParameter- Returns:
- The value of the
valueattribute
-
type
public ColumnInfoTypeName type()
- Specified by:
typein interfaceSqlParameter- Returns:
- The value of the
typeattribute
-
cardinal
public int cardinal()
- Specified by:
cardinalin interfaceSqlParameter- Returns:
- The value of the
cardinalattribute
-
withValue
public final ImmutableSqlParameter withValue(@Nullable Object value)
Copy the current immutable object by setting a value for thevalueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value (can benull)- Returns:
- A modified copy of the
thisobject
-
withType
public final ImmutableSqlParameter withType(ColumnInfoTypeName value)
Copy the current immutable object by setting a value for thetypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
withCardinal
public final ImmutableSqlParameter withCardinal(int value)
Copy the current immutable object by setting a value for thecardinalattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for cardinal- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableSqlParameterthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:value,type,cardinal.
-
toString
public String toString()
Prints the immutable valueSqlParameterwith attribute values.
-
copyOf
public static ImmutableSqlParameter copyOf(SqlParameter instance)
Creates an immutable copy of aSqlParametervalue. 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 SqlParameter instance
-
builder
public static ImmutableSqlParameter.Builder builder()
Creates a builder forImmutableSqlParameter.ImmutableSqlParameter.builder() .value(Object | null) // nullablevalue.type(com.databricks.jdbc.model.core.ColumnInfoTypeName) // requiredtype.cardinal(int) // requiredcardinal.build();- Returns:
- A new ImmutableSqlParameter builder
-
-