Class ImmutablePlan.Builder

java.lang.Object
io.substrait.plan.ImmutablePlan.Builder
Enclosing class:
ImmutablePlan

public static final class ImmutablePlan.Builder extends Object
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 Details

    • from

      public final ImmutablePlan.Builder from(Plan instance)
      Fill a builder with attribute values from the provided Plan instance. 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:
      this builder for use in a chained invocation
    • version

      public final ImmutablePlan.Builder version(Plan.Version version)
      Initializes the value for the version attribute.

      If not set, this attribute will have a default value as returned by the initializer of version.

      Parameters:
      version - The value for version
      Returns:
      this builder for use in a chained invocation
    • addRoots

      public final ImmutablePlan.Builder addRoots(Plan.Root element)
      Adds one element to roots list.
      Parameters:
      element - A roots element
      Returns:
      this builder for use in a chained invocation
    • addRoots

      public final ImmutablePlan.Builder addRoots(Plan.Root... elements)
      Adds elements to roots list.
      Parameters:
      elements - An array of roots elements
      Returns:
      this builder for use in a chained invocation
    • roots

      public final ImmutablePlan.Builder roots(Iterable<? extends Plan.Root> elements)
      Sets or replaces all elements for roots list.
      Parameters:
      elements - An iterable of roots elements
      Returns:
      this builder for use in a chained invocation
    • addAllRoots

      public final ImmutablePlan.Builder addAllRoots(Iterable<? extends Plan.Root> elements)
      Adds elements to roots list.
      Parameters:
      elements - An iterable of roots elements
      Returns:
      this builder for use in a chained invocation
    • addExpectedTypeUrls

      public final ImmutablePlan.Builder addExpectedTypeUrls(String element)
      Adds one element to expectedTypeUrls list.
      Parameters:
      element - A expectedTypeUrls element
      Returns:
      this builder for use in a chained invocation
    • addExpectedTypeUrls

      public final ImmutablePlan.Builder addExpectedTypeUrls(String... elements)
      Adds elements to expectedTypeUrls list.
      Parameters:
      elements - An array of expectedTypeUrls elements
      Returns:
      this builder for use in a chained invocation
    • expectedTypeUrls

      public final ImmutablePlan.Builder expectedTypeUrls(Iterable<String> elements)
      Sets or replaces all elements for expectedTypeUrls list.
      Parameters:
      elements - An iterable of expectedTypeUrls elements
      Returns:
      this builder for use in a chained invocation
    • addAllExpectedTypeUrls

      public final ImmutablePlan.Builder addAllExpectedTypeUrls(Iterable<String> elements)
      Adds elements to expectedTypeUrls list.
      Parameters:
      elements - An iterable of expectedTypeUrls elements
      Returns:
      this builder for use in a chained invocation
    • advancedExtension

      public final ImmutablePlan.Builder advancedExtension(AdvancedExtension advancedExtension)
      Initializes the optional value advancedExtension to advancedExtension.
      Parameters:
      advancedExtension - The value for advancedExtension
      Returns:
      this builder for chained invocation
    • advancedExtension

      public final ImmutablePlan.Builder advancedExtension(Optional<? extends AdvancedExtension> advancedExtension)
      Initializes the optional value advancedExtension to advancedExtension.
      Parameters:
      advancedExtension - The value for advancedExtension
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePlan build()
      Builds a new ImmutablePlan.
      Returns:
      An immutable instance of Plan
      Throws:
      IllegalStateException - if any required attributes are missing