Package io.substrait.type
Class ImmutableType.UserDefined
java.lang.Object
io.substrait.type.Type.UserDefined
io.substrait.type.ImmutableType.UserDefined
- All Implemented Interfaces:
FunctionArg,NullableType,ParameterizedType,TypeExpression,Type
- Enclosing class:
- ImmutableType
Immutable implementation of
Type.UserDefined.
Use the builder to create immutable instances:
ImmutableType.UserDefined.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.substrait.expression.FunctionArg
FunctionArg.FuncArgVisitor<R,C extends VisitationContext, E extends Throwable>, FunctionArg.ProtoFrom Nested classes/interfaces inherited from interface io.substrait.function.ParameterizedType
ParameterizedType.BaseParameterizedType, ParameterizedType.NullableParameterizedType, ParameterizedType.RequiredParameterizedVisitorException, ParameterizedType.StringLiteralNested classes/interfaces inherited from interface io.substrait.type.Type
Type.Binary, Type.Bool, Type.Date, Type.Decimal, Type.FixedBinary, Type.FixedChar, Type.FP32, Type.FP64, Type.Func, Type.I16, Type.I32, Type.I64, Type.I8, Type.IntervalCompound, Type.IntervalDay, Type.IntervalYear, Type.ListType, Type.Map, Type.Parameter, Type.ParameterBooleanValue, Type.ParameterDataType, Type.ParameterEnumValue, Type.ParameterIntegerValue, Type.ParameterNull, Type.ParameterStringValue, Type.PrecisionTime, Type.PrecisionTimestamp, Type.PrecisionTimestampTZ, Type.Str, Type.Struct, Type.Time, Type.Timestamp, Type.TimestampTZ, Type.UserDefined, Type.UUID, Type.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 forUserDefined.static ImmutableType.UserDefinedcopyOf(Type.UserDefined instance) Creates an immutable copy of aType.UserDefinedvalue.booleanThis instance is equal to all instances ofUserDefinedthat have equal attribute values.inthashCode()Computes a hash code from attributes:nullable,urn,name,typeParameters.name()booleannullable()toString()Prints the immutable valueUserDefinedwith attribute values.Returns the type parameters for this user-defined type.urn()Copy the current immutable object by setting a value for thenameattribute.withNullable(boolean value) Copy the current immutable object by setting a value for thenullableattribute.withTypeParameters(Type.Parameter... elements) Copy the current immutable object with elements that replace the content oftypeParameters.withTypeParameters(Iterable<? extends Type.Parameter> elements) Copy the current immutable object with elements that replace the content oftypeParameters.Copy the current immutable object by setting a value for theurnattribute.Methods inherited from class io.substrait.type.Type.UserDefined
acceptMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.substrait.function.ParameterizedType
isWildcardMethods inherited from interface io.substrait.type.Type
accept, equalsIgnoringNullability
-
Method Details
-
nullable
public boolean nullable()- Returns:
- The value of the
nullableattribute
-
urn
- Specified by:
urnin classType.UserDefined- Returns:
- The value of the
urnattribute
-
name
- Specified by:
namein classType.UserDefined- Returns:
- The value of the
nameattribute
-
typeParameters
Returns the type parameters for this user-defined type.Type parameters are used to represent parameterized/generic types, such as
vector<i32>.- Overrides:
typeParametersin classType.UserDefined- Returns:
- a list of type parameters, or an empty list if this type is not parameterized
-
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
-
withUrn
Copy the current immutable object by setting a value for theurnattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for urn- Returns:
- A modified copy or the
thisobject
-
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 or the
thisobject
-
withTypeParameters
Copy the current immutable object with elements that replace the content oftypeParameters.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTypeParameters
public final ImmutableType.UserDefined withTypeParameters(Iterable<? extends Type.Parameter> elements) Copy the current immutable object with elements that replace the content oftypeParameters. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of typeParameters elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofUserDefinedthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:nullable,urn,name,typeParameters. -
toString
Prints the immutable valueUserDefinedwith attribute values. -
copyOf
Creates an immutable copy of aType.UserDefinedvalue. 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 UserDefined instance
-
builder
Creates a builder forUserDefined.ImmutableType.UserDefined.builder() .nullable(boolean) // requirednullable.urn(String) // requiredurn.name(String) // requiredname.addTypeParameters|addAllTypeParameters(io.substrait.type.Type.Parameter) //typeParameterselements .build();- Returns:
- A new UserDefined builder
-