Class ImmutableSimpleExtension.EnumArgument

java.lang.Object
io.substrait.extension.SimpleExtension.EnumArgument
io.substrait.extension.ImmutableSimpleExtension.EnumArgument
All Implemented Interfaces:
SimpleExtension.Argument
Enclosing class:
ImmutableSimpleExtension

public static final class ImmutableSimpleExtension.EnumArgument extends SimpleExtension.EnumArgument
Immutable implementation of SimpleExtension.EnumArgument.

Use the builder to create immutable instances: ImmutableSimpleExtension.EnumArgument.builder().

  • Method Details

    • name

      public @Nullable String name()
      Returns:
      The value of the name attribute
    • description

      public @Nullable String description()
      Returns:
      The value of the description attribute
    • options

      public List<String> options()
      Specified by:
      options in class SimpleExtension.EnumArgument
      Returns:
      The value of the options attribute
    • withName

      public final ImmutableSimpleExtension.EnumArgument withName(@Nullable 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 (can be null)
      Returns:
      A modified copy or the this object
    • withDescription

      public final ImmutableSimpleExtension.EnumArgument withDescription(@Nullable String value)
      Copy the current immutable object by setting a value for the description attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for description (can be null)
      Returns:
      A modified copy or the this object
    • withOptions

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

      public final ImmutableSimpleExtension.EnumArgument withOptions(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of options. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of options 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 EnumArgument 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, description, options.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      Creates a builder for EnumArgument.
       ImmutableSimpleExtension.EnumArgument.builder()
          .name(String | null) // nullable name
          .description(String | null) // nullable description
          .addOptions|addAllOptions(String) // options elements
          .build();
       
      Returns:
      A new EnumArgument builder