Class ImmutableExpression.InPredicate

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

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

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

  • Method Details

    • haystack

      public Rel haystack()
      Specified by:
      haystack in class Expression.InPredicate
      Returns:
      The value of the haystack attribute
    • needles

      public List<Expression> needles()
      Specified by:
      needles in class Expression.InPredicate
      Returns:
      The value of the needles attribute
    • withHaystack

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

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

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

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

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

      public static ImmutableExpression.InPredicate.Builder builder()
      Creates a builder for InPredicate.
       ImmutableExpression.InPredicate.builder()
          .haystack(io.substrait.relation.Rel) // required haystack
          .addNeedles|addAllNeedles(io.substrait.expression.Expression) // needles elements
          .build();
       
      Returns:
      A new InPredicate builder