Class ImmutableExpression.Cast

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

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

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

  • Method Details

    • type

      public Type type()
      Specified by:
      type in class Expression.Cast
      Returns:
      The value of the type attribute
    • input

      public Expression input()
      Specified by:
      input in class Expression.Cast
      Returns:
      The value of the input attribute
    • failureBehavior

      public Expression.FailureBehavior failureBehavior()
      Specified by:
      failureBehavior in class Expression.Cast
      Returns:
      The value of the failureBehavior attribute
    • withType

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

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

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

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

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

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

      public static ImmutableExpression.Cast.Builder builder()
      Creates a builder for Cast.
       ImmutableExpression.Cast.builder()
          .type(io.substrait.type.Type) // required type
          .input(io.substrait.expression.Expression) // required input
          .failureBehavior(io.substrait.expression.Expression.FailureBehavior) // required failureBehavior
          .build();
       
      Returns:
      A new Cast builder