Package io.substrait.function
Class ImmutableParameterizedType.Decimal
java.lang.Object
io.substrait.function.ParameterizedType.BaseParameterizedType
io.substrait.function.ParameterizedType.Decimal
io.substrait.function.ImmutableParameterizedType.Decimal
- All Implemented Interfaces:
NullableType,ParameterizedType,TypeExpression
- Enclosing class:
- ImmutableParameterizedType
Immutable implementation of
ParameterizedType.Decimal.
Use the builder to create immutable instances:
ImmutableParameterizedType.Decimal.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.substrait.function.ParameterizedType
ParameterizedType.BaseParameterizedType, ParameterizedType.Decimal, ParameterizedType.FixedBinary, ParameterizedType.FixedChar, ParameterizedType.Func, ParameterizedType.IntervalCompound, ParameterizedType.IntervalDay, ParameterizedType.ListType, ParameterizedType.Map, ParameterizedType.NullableParameterizedType, ParameterizedType.PrecisionTime, ParameterizedType.PrecisionTimestamp, ParameterizedType.PrecisionTimestampTZ, ParameterizedType.RequiredParameterizedVisitorException, ParameterizedType.StringLiteral, ParameterizedType.Struct, ParameterizedType.VarCharNested classes/interfaces inherited from interface io.substrait.function.TypeExpression
TypeExpression.BaseTypeExpression, TypeExpression.BinaryOperation, TypeExpression.IfOperation, TypeExpression.IntegerLiteral, TypeExpression.NotOperation, TypeExpression.RequiredTypeExpressionVisitorException, TypeExpression.ReturnProgram -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forDecimal.copyOf(ParameterizedType.Decimal instance) Creates an immutable copy of aParameterizedType.Decimalvalue.booleanThis instance is equal to all instances ofDecimalthat have equal attribute values.inthashCode()Computes a hash code from attributes:nullable,scale,precision.booleannullable()scale()toString()Prints the immutable valueDecimalwith attribute values.withNullable(boolean value) Copy the current immutable object by setting a value for thenullableattribute.Copy the current immutable object by setting a value for theprecisionattribute.Copy the current immutable object by setting a value for thescaleattribute.Methods inherited from class io.substrait.function.ParameterizedType.BaseParameterizedType
acceptMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.substrait.function.ParameterizedType
isWildcard
-
Method Details
-
nullable
public boolean nullable()- Returns:
- The value of the
nullableattribute
-
scale
- Specified by:
scalein classParameterizedType.Decimal- Returns:
- The value of the
scaleattribute
-
precision
- Specified by:
precisionin classParameterizedType.Decimal- Returns:
- The value of the
precisionattribute
-
withNullable
Copy the current immutable object by setting a value for thenullableattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for nullable- Returns:
- A modified copy or the
thisobject
-
withScale
Copy the current immutable object by setting a value for thescaleattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for scale- Returns:
- A modified copy or the
thisobject
-
withPrecision
public final ImmutableParameterizedType.Decimal withPrecision(ParameterizedType.StringLiteral value) Copy the current immutable object by setting a value for theprecisionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for precision- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofDecimalthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:nullable,scale,precision. -
toString
Prints the immutable valueDecimalwith attribute values. -
copyOf
Creates an immutable copy of aParameterizedType.Decimalvalue. 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 Decimal instance
-
builder
Creates a builder forDecimal.ImmutableParameterizedType.Decimal.builder() .nullable(boolean) // requirednullable.scale(io.substrait.function.ParameterizedType.StringLiteral) // requiredscale.precision(io.substrait.function.ParameterizedType.StringLiteral) // requiredprecision.build();- Returns:
- A new Decimal builder
-