Class ImmutableListElement

java.lang.Object
io.substrait.expression.FieldReference.ListElement
io.substrait.expression.ImmutableListElement
All Implemented Interfaces:
FieldReference.ReferenceSegment

public final class ImmutableListElement extends FieldReference.ListElement
Immutable implementation of FieldReference.ListElement.

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

  • Method Details

    • offset

      public int offset()
      Specified by:
      offset in class FieldReference.ListElement
      Returns:
      The value of the offset attribute
    • withOffset

      public final ImmutableListElement withOffset(int value)
      Copy the current immutable object by setting a value for the offset attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for offset
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableListElement 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: offset.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableListElement copyOf(FieldReference.ListElement instance)
      Creates an immutable copy of a FieldReference.ListElement 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 ListElement instance
    • builder

      public static ImmutableListElement.Builder builder()
      Creates a builder for ImmutableListElement.
       ImmutableListElement.builder()
          .offset(int) // required offset
          .build();
       
      Returns:
      A new ImmutableListElement builder