Package io.substrait.plan
Class ImmutablePlan.Builder
java.lang.Object
io.substrait.plan.ImmutablePlan.Builder
- Enclosing class:
- ImmutablePlan
Builds instances of type
ImmutablePlan.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionfinal ImmutablePlan.BuilderaddAllExpectedTypeUrls(Iterable<String> elements) Adds elements toexpectedTypeUrlslist.final ImmutablePlan.BuilderaddAllRoots(Iterable<? extends Plan.Root> elements) Adds elements torootslist.final ImmutablePlan.BuilderaddExpectedTypeUrls(String element) Adds one element toexpectedTypeUrlslist.final ImmutablePlan.BuilderaddExpectedTypeUrls(String... elements) Adds elements toexpectedTypeUrlslist.final ImmutablePlan.BuilderAdds one element torootslist.final ImmutablePlan.BuilderAdds elements torootslist.final ImmutablePlan.BuilderadvancedExtension(AdvancedExtension advancedExtension) Initializes the optional valueadvancedExtensionto advancedExtension.final ImmutablePlan.BuilderadvancedExtension(Optional<? extends AdvancedExtension> advancedExtension) Initializes the optional valueadvancedExtensionto advancedExtension.build()Builds a newImmutablePlan.final ImmutablePlan.BuilderexpectedTypeUrls(Iterable<String> elements) Sets or replaces all elements forexpectedTypeUrlslist.final ImmutablePlan.BuilderFill a builder with attribute values from the providedPlaninstance.final ImmutablePlan.BuilderSets or replaces all elements forrootslist.final ImmutablePlan.Builderversion(Plan.Version version) Initializes the value for theversionattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedPlaninstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
version
Initializes the value for theversionattribute.If not set, this attribute will have a default value as returned by the initializer of
version.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
addRoots
Adds one element torootslist.- Parameters:
element- A roots element- Returns:
thisbuilder for use in a chained invocation
-
addRoots
Adds elements torootslist.- Parameters:
elements- An array of roots elements- Returns:
thisbuilder for use in a chained invocation
-
roots
Sets or replaces all elements forrootslist.- Parameters:
elements- An iterable of roots elements- Returns:
thisbuilder for use in a chained invocation
-
addAllRoots
Adds elements torootslist.- Parameters:
elements- An iterable of roots elements- Returns:
thisbuilder for use in a chained invocation
-
addExpectedTypeUrls
Adds one element toexpectedTypeUrlslist.- Parameters:
element- A expectedTypeUrls element- Returns:
thisbuilder for use in a chained invocation
-
addExpectedTypeUrls
Adds elements toexpectedTypeUrlslist.- Parameters:
elements- An array of expectedTypeUrls elements- Returns:
thisbuilder for use in a chained invocation
-
expectedTypeUrls
Sets or replaces all elements forexpectedTypeUrlslist.- Parameters:
elements- An iterable of expectedTypeUrls elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExpectedTypeUrls
Adds elements toexpectedTypeUrlslist.- Parameters:
elements- An iterable of expectedTypeUrls elements- Returns:
thisbuilder for use in a chained invocation
-
advancedExtension
Initializes the optional valueadvancedExtensionto advancedExtension.- Parameters:
advancedExtension- The value for advancedExtension- Returns:
thisbuilder for chained invocation
-
advancedExtension
public final ImmutablePlan.Builder advancedExtension(Optional<? extends AdvancedExtension> advancedExtension) Initializes the optional valueadvancedExtensionto advancedExtension.- Parameters:
advancedExtension- The value for advancedExtension- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutablePlan.- Returns:
- An immutable instance of Plan
- Throws:
IllegalStateException- if any required attributes are missing
-