Class ImmutableFunctionOption

java.lang.Object
io.substrait.expression.FunctionOption
io.substrait.expression.ImmutableFunctionOption

public final class ImmutableFunctionOption extends FunctionOption
Immutable implementation of FunctionOption.

Use the builder to create immutable instances: ImmutableFunctionOption.builder().

  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in class FunctionOption
      Returns:
      The value of the name attribute
    • values

      public List<String> values()
      Specified by:
      values in class FunctionOption
      Returns:
      The value of the values attribute
    • withName

      public final ImmutableFunctionOption withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy or the this object
    • withValues

      public final ImmutableFunctionOption withValues(String... elements)
      Copy the current immutable object with elements that replace the content of values.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withValues

      public final ImmutableFunctionOption withValues(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of values elements to set
      Returns:
      A modified copy or this if not changed
    • equals

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

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

      public static ImmutableFunctionOption copyOf(FunctionOption instance)
      Creates an immutable copy of a FunctionOption 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 FunctionOption instance
    • builder

      public static ImmutableFunctionOption.Builder builder()
      Creates a builder for ImmutableFunctionOption.
       ImmutableFunctionOption.builder()
          .name(String) // required name
          .addValues|addAllValues(String) // values elements
          .build();
       
      Returns:
      A new ImmutableFunctionOption builder