Class ImmutableTypeExpression.Func

All Implemented Interfaces:
NullableType, TypeExpression
Enclosing class:
ImmutableTypeExpression

public static final class ImmutableTypeExpression.Func extends TypeExpression.Func
Immutable implementation of TypeExpression.Func.

Use the builder to create immutable instances: ImmutableTypeExpression.Func.builder().

  • Method Details

    • nullable

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

      public List<TypeExpression> parameterTypes()
      Specified by:
      parameterTypes in class TypeExpression.Func
      Returns:
      The value of the parameterTypes attribute
    • returnType

      public TypeExpression returnType()
      Specified by:
      returnType in class TypeExpression.Func
      Returns:
      The value of the returnType attribute
    • withNullable

      public final ImmutableTypeExpression.Func 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
    • withParameterTypes

      public final ImmutableTypeExpression.Func withParameterTypes(TypeExpression... elements)
      Copy the current immutable object with elements that replace the content of parameterTypes.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withParameterTypes

      public final ImmutableTypeExpression.Func withParameterTypes(Iterable<? extends TypeExpression> elements)
      Copy the current immutable object with elements that replace the content of parameterTypes. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of parameterTypes elements to set
      Returns:
      A modified copy or this if not changed
    • withReturnType

      public final ImmutableTypeExpression.Func withReturnType(TypeExpression value)
      Copy the current immutable object by setting a value for the returnType attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for returnType
      Returns:
      A modified copy or the this object
    • equals

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

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

      public static ImmutableTypeExpression.Func copyOf(TypeExpression.Func instance)
      Creates an immutable copy of a TypeExpression.Func 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 Func instance
    • builder

      public static ImmutableTypeExpression.Func.Builder builder()
      Creates a builder for Func.
       ImmutableTypeExpression.Func.builder()
          .nullable(boolean) // required nullable
          .addParameterTypes|addAllParameterTypes(io.substrait.function.TypeExpression) // parameterTypes elements
          .returnType(io.substrait.function.TypeExpression) // required returnType
          .build();
       
      Returns:
      A new Func builder