Class ImmutableRemap

java.lang.Object
io.substrait.relation.Rel.Remap
io.substrait.relation.ImmutableRemap

public final class ImmutableRemap extends Rel.Remap
Immutable implementation of Rel.Remap.

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

  • Method Details

    • indices

      public List<Integer> indices()
      Specified by:
      indices in class Rel.Remap
      Returns:
      The value of the indices attribute
    • withIndices

      public final ImmutableRemap withIndices(int... elements)
      Copy the current immutable object with elements that replace the content of indices.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withIndices

      public final ImmutableRemap withIndices(Iterable<Integer> elements)
      Copy the current immutable object with elements that replace the content of indices. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of indices 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 ImmutableRemap 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: indices.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableRemap copyOf(Rel.Remap instance)
      Creates an immutable copy of a Rel.Remap 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 Remap instance
    • builder

      public static ImmutableRemap.Builder builder()
      Creates a builder for ImmutableRemap.
       ImmutableRemap.builder()
          .addIndices|addAllIndices(int) // indices elements
          .build();
       
      Returns:
      A new ImmutableRemap builder