Package io.substrait.plan
Class ImmutablePlan
java.lang.Object
io.substrait.plan.Plan
io.substrait.plan.ImmutablePlan
Immutable implementation of
Plan.
Use the builder to create immutable instances:
ImmutablePlan.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.substrait.plan.Plan
Plan.Root, Plan.Version -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutablePlan.Builderbuilder()Creates a builder forImmutablePlan.static ImmutablePlanCreates an immutable copy of aPlanvalue.booleanThis instance is equal to all instances ofImmutablePlanthat have equal attribute values.getRoots()inthashCode()Computes a hash code from attributes:version,roots,expectedTypeUrls,advancedExtension.toString()Prints the immutable valuePlanwith attribute values.final ImmutablePlanCopy the current immutable object by setting a present value for the optionaladvancedExtensionattribute.final ImmutablePlanwithAdvancedExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theadvancedExtensionattribute.final ImmutablePlanwithExpectedTypeUrls(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofexpectedTypeUrls.final ImmutablePlanwithExpectedTypeUrls(String... elements) Copy the current immutable object with elements that replace the content ofexpectedTypeUrls.final ImmutablePlanCopy the current immutable object with elements that replace the content ofroots.final ImmutablePlanCopy the current immutable object with elements that replace the content ofroots.final ImmutablePlanwithVersion(Plan.Version value) Copy the current immutable object by setting a value for theversionattribute.
-
Method Details
-
getVersion
- Overrides:
getVersionin classPlan- Returns:
- The value of the
versionattribute
-
getRoots
-
getExpectedTypeUrls
- Specified by:
getExpectedTypeUrlsin classPlan- Returns:
- The value of the
expectedTypeUrlsattribute
-
getAdvancedExtension
- Specified by:
getAdvancedExtensionin classPlan- Returns:
- The value of the
advancedExtensionattribute
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy or the
thisobject
-
withRoots
Copy the current immutable object with elements that replace the content ofroots.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withRoots
Copy the current immutable object with elements that replace the content ofroots. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of roots elements to set- Returns:
- A modified copy or
thisif not changed
-
withExpectedTypeUrls
Copy the current immutable object with elements that replace the content ofexpectedTypeUrls.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withExpectedTypeUrls
Copy the current immutable object with elements that replace the content ofexpectedTypeUrls. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of expectedTypeUrls elements to set- Returns:
- A modified copy or
thisif not changed
-
withAdvancedExtension
Copy the current immutable object by setting a present value for the optionaladvancedExtensionattribute.- Parameters:
value- The value for advancedExtension- Returns:
- A modified copy or
thisif not changed
-
withAdvancedExtension
Copy the current immutable object by setting an optional value for theadvancedExtensionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for advancedExtension- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutablePlanthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:version,roots,expectedTypeUrls,advancedExtension. -
toString
Prints the immutable valuePlanwith attribute values. -
copyOf
Creates an immutable copy of aPlanvalue. 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 Plan instance
-
builder
Creates a builder forImmutablePlan.ImmutablePlan.builder() .version(io.substrait.plan.Plan.Version) // optionalversion.addRoots|addAllRoots(io.substrait.plan.Plan.Root) //rootselements .addExpectedTypeUrls|addAllExpectedTypeUrls(String) //expectedTypeUrlselements .advancedExtension(Optional<io.substrait.extension.AdvancedExtension>) // optionaladvancedExtension.build();- Returns:
- A new ImmutablePlan builder
-