Class ImmutableExpression.IntervalYearLiteral

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

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

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

  • Method Details

    • nullable

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

      public int years()
      Specified by:
      years in class Expression.IntervalYearLiteral
      Returns:
      The value of the years attribute
    • months

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

      public final ImmutableExpression.IntervalYearLiteral 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
    • withYears

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

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

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

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

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

      Creates a builder for IntervalYearLiteral.
       ImmutableExpression.IntervalYearLiteral.builder()
          .nullable(boolean) // optional nullable
          .years(int) // required years
          .months(int) // required months
          .build();
       
      Returns:
      A new IntervalYearLiteral builder