Class ImmutableExpression.SortField

java.lang.Object
io.substrait.expression.Expression.SortField
io.substrait.expression.ImmutableExpression.SortField
Enclosing class:
ImmutableExpression

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

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

  • Method Details

    • expr

      public Expression expr()
      Specified by:
      expr in class Expression.SortField
      Returns:
      The value of the expr attribute
    • direction

      public Expression.SortDirection direction()
      Specified by:
      direction in class Expression.SortField
      Returns:
      The value of the direction attribute
    • withExpr

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

      public final ImmutableExpression.SortField withDirection(Expression.SortDirection value)
      Copy the current immutable object by setting a value for the direction attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for direction
      Returns:
      A modified copy or the this object
    • equals

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

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

      public static ImmutableExpression.SortField copyOf(Expression.SortField instance)
      Creates an immutable copy of a Expression.SortField 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 SortField instance
    • builder

      public static ImmutableExpression.SortField.Builder builder()
      Creates a builder for SortField.
       ImmutableExpression.SortField.builder()
          .expr(io.substrait.expression.Expression) // required expr
          .direction(io.substrait.expression.Expression.SortDirection) // required direction
          .build();
       
      Returns:
      A new SortField builder