Class ImmutableRoot

java.lang.Object
io.substrait.plan.Plan.Root
io.substrait.plan.ImmutableRoot

public final class ImmutableRoot extends Plan.Root
Immutable implementation of Plan.Root.

Use the builder to create immutable instances: ImmutableRoot.builder().

  • Method Details

    • getInput

      public Rel getInput()
      Specified by:
      getInput in class Plan.Root
      Returns:
      The value of the input attribute
    • getNames

      public List<String> getNames()
      Specified by:
      getNames in class Plan.Root
      Returns:
      The value of the names attribute
    • withInput

      public final ImmutableRoot withInput(Rel value)
      Copy the current immutable object by setting a value for the input attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for input
      Returns:
      A modified copy or the this object
    • withNames

      public final ImmutableRoot withNames(String... elements)
      Copy the current immutable object with elements that replace the content of names.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withNames

      public final ImmutableRoot withNames(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of names. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of names elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableRoot that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: input, names.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Root with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableRoot copyOf(Plan.Root instance)
      Creates an immutable copy of a Plan.Root value. 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 Root instance
    • builder

      public static ImmutableRoot.Builder builder()
      Creates a builder for ImmutableRoot.
       ImmutableRoot.builder()
          .input(io.substrait.relation.Rel) // required input
          .addNames|addAllNames(String) // names elements
          .build();
       
      Returns:
      A new ImmutableRoot builder