Package io.substrait.type
Class ImmutableNamedStruct
java.lang.Object
io.substrait.type.ImmutableNamedStruct
- All Implemented Interfaces:
NamedStruct
Immutable implementation of
NamedStruct.
Use the builder to create immutable instances:
ImmutableNamedStruct.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableNamedStruct. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableNamedStruct.Builderbuilder()Creates a builder forImmutableNamedStruct.static ImmutableNamedStructcopyOf(NamedStruct instance) Creates an immutable copy of aNamedStructvalue.booleanThis instance is equal to all instances ofImmutableNamedStructthat have equal attribute values.inthashCode()Computes a hash code from attributes:struct,names.names()struct()toString()Prints the immutable valueNamedStructwith attribute values.final ImmutableNamedStructCopy the current immutable object with elements that replace the content ofnames.final ImmutableNamedStructCopy the current immutable object with elements that replace the content ofnames.final ImmutableNamedStructwithStruct(Type.Struct value) Copy the current immutable object by setting a value for thestructattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.substrait.type.NamedStruct
toProto
-
Method Details
-
struct
- Specified by:
structin interfaceNamedStruct- Returns:
- The value of the
structattribute
-
names
- Specified by:
namesin interfaceNamedStruct- Returns:
- The value of the
namesattribute
-
withStruct
Copy the current immutable object by setting a value for thestructattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for struct- Returns:
- A modified copy or the
thisobject
-
withNames
Copy the current immutable object with elements that replace the content ofnames.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withNames
Copy the current immutable object with elements that replace the content ofnames. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of names elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableNamedStructthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:struct,names. -
toString
Prints the immutable valueNamedStructwith attribute values. -
copyOf
Creates an immutable copy of aNamedStructvalue. 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 NamedStruct instance
-
builder
Creates a builder forImmutableNamedStruct.ImmutableNamedStruct.builder() .struct(io.substrait.type.Type.Struct) // requiredstruct.addNames|addAllNames(String) //nameselements .build();- Returns:
- A new ImmutableNamedStruct builder
-