Class ImmutableExpression.DecimalLiteral

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

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

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

  • Method Details

    • nullable

      public boolean nullable()
      Returns:
      The value of the nullable attribute
    • value

      public com.google.protobuf.ByteString value()
      Specified by:
      value in class Expression.DecimalLiteral
      Returns:
      The value of the value attribute
    • precision

      public int precision()
      Specified by:
      precision in class Expression.DecimalLiteral
      Returns:
      The value of the precision attribute
    • scale

      public int scale()
      Specified by:
      scale in class Expression.DecimalLiteral
      Returns:
      The value of the scale attribute
    • withNullable

      public final ImmutableExpression.DecimalLiteral withNullable(boolean value)
      Copy the current immutable object by setting a value for the nullable attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for nullable
      Returns:
      A modified copy or the this object
    • withValue

      public final ImmutableExpression.DecimalLiteral withValue(com.google.protobuf.ByteString value)
      Copy the current immutable object by setting a value for the value attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for value
      Returns:
      A modified copy or the this object
    • withPrecision

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

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

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

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

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

      Creates a builder for DecimalLiteral.
       ImmutableExpression.DecimalLiteral.builder()
          .nullable(boolean) // optional nullable
          .value(com.google.protobuf.ByteString) // required value
          .precision(int) // required precision
          .scale(int) // required scale
          .build();
       
      Returns:
      A new DecimalLiteral builder