Class ImmutableExpression.MapLiteral

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

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

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

  • Method Details

    • nullable

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

      Specified by:
      values in class Expression.MapLiteral
      Returns:
      The value of the values attribute
    • withNullable

      public final ImmutableExpression.MapLiteral 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
    • withValues

      public final ImmutableExpression.MapLiteral withValues(Map<? extends Expression.Literal,? extends Expression.Literal> entries)
      Copy the current immutable object by replacing the values map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to replace the values map
      Returns:
      A modified copy or this if not changed
    • equals

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

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

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

      public static ImmutableExpression.MapLiteral.Builder builder()
      Creates a builder for MapLiteral.
       ImmutableExpression.MapLiteral.builder()
          .nullable(boolean) // optional nullable
          .putValues|putAllValues(io.substrait.expression.Expression.Literal => io.substrait.expression.Expression.Literal) // values mappings
          .build();
       
      Returns:
      A new MapLiteral builder