Class ImmutableExpression.IntervalCompoundLiteral

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

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

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

  • Method Details

    • nullable

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

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

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

      public int days()
      Specified by:
      days in class Expression.IntervalCompoundLiteral
      Returns:
      The value of the days attribute
    • seconds

      public int seconds()
      Specified by:
      seconds in class Expression.IntervalCompoundLiteral
      Returns:
      The value of the seconds attribute
    • subseconds

      public long subseconds()
      Specified by:
      subseconds in class Expression.IntervalCompoundLiteral
      Returns:
      The value of the subseconds attribute
    • precision

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

      public final ImmutableExpression.IntervalCompoundLiteral 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.IntervalCompoundLiteral 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.IntervalCompoundLiteral 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
    • withDays

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

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

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

      public final ImmutableExpression.IntervalCompoundLiteral 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
    • equals

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

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

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

      Creates a builder for IntervalCompoundLiteral.
       ImmutableExpression.IntervalCompoundLiteral.builder()
          .nullable(boolean) // optional nullable
          .years(int) // required years
          .months(int) // required months
          .days(int) // required days
          .seconds(int) // required seconds
          .subseconds(long) // required subseconds
          .precision(int) // required precision
          .build();
       
      Returns:
      A new IntervalCompoundLiteral builder