Class ImmutableExpression.SingleOrList

java.lang.Object
io.substrait.expression.Expression.SingleOrList
io.substrait.expression.ImmutableExpression.SingleOrList
All Implemented Interfaces:
Expression, FunctionArg
Enclosing class:
ImmutableExpression

public static final class ImmutableExpression.SingleOrList extends Expression.SingleOrList
Immutable implementation of Expression.SingleOrList.

Use the builder to create immutable instances: ImmutableExpression.SingleOrList.builder().

  • Method Details

    • condition

      public Expression condition()
      Specified by:
      condition in class Expression.SingleOrList
      Returns:
      The value of the condition attribute
    • options

      public List<Expression> options()
      Specified by:
      options in class Expression.SingleOrList
      Returns:
      The value of the options attribute
    • withCondition

      public final ImmutableExpression.SingleOrList withCondition(Expression value)
      Copy the current immutable object by setting a value for the condition attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for condition
      Returns:
      A modified copy or the this object
    • withOptions

      public final ImmutableExpression.SingleOrList withOptions(Expression... elements)
      Copy the current immutable object with elements that replace the content of options.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withOptions

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

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

      Creates an immutable copy of a Expression.SingleOrList 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 SingleOrList instance
    • builder

      Creates a builder for SingleOrList.
       ImmutableExpression.SingleOrList.builder()
          .condition(io.substrait.expression.Expression) // required condition
          .addOptions|addAllOptions(io.substrait.expression.Expression) // options elements
          .build();
       
      Returns:
      A new SingleOrList builder