Class ImmutableSimpleExtension.Type

java.lang.Object
io.substrait.extension.SimpleExtension.Type
io.substrait.extension.ImmutableSimpleExtension.Type
Enclosing class:
ImmutableSimpleExtension

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

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

  • Method Details

    • name

      public String name()
      Specified by:
      name in class SimpleExtension.Type
      Returns:
      The value of the name attribute
    • description

      public Optional<String> description()
      Specified by:
      description in class SimpleExtension.Type
      Returns:
      The value of the description attribute
    • urn

      public String urn()
      Specified by:
      urn in class SimpleExtension.Type
      Returns:
      The value of the urn attribute
    • structure

      protected Optional<Object> structure()
      Specified by:
      structure in class SimpleExtension.Type
      Returns:
      The value of the structure attribute
    • parameters

      protected Optional<List<Object>> parameters()
      Specified by:
      parameters in class SimpleExtension.Type
      Returns:
      The value of the parameters attribute
    • variadic

      protected Optional<Boolean> variadic()
      Specified by:
      variadic in class SimpleExtension.Type
      Returns:
      The value of the variadic attribute
    • metadata

      public Optional<Map<String,Object>> metadata()
      Specified by:
      metadata in class SimpleExtension.Type
      Returns:
      The value of the metadata attribute
    • withName

      public final ImmutableSimpleExtension.Type 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
    • withDescription

      public final ImmutableSimpleExtension.Type withDescription(String value)
      Copy the current immutable object by setting a present value for the optional description attribute.
      Parameters:
      value - The value for description
      Returns:
      A modified copy or this if not changed
    • withDescription

      public final ImmutableSimpleExtension.Type withDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the description attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for description
      Returns:
      A modified copy or this if not changed
    • withUrn

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

      public final ImmutableSimpleExtension.Type withStructure(Object value)
      Copy the current immutable object by setting a present value for the optional structure attribute.
      Parameters:
      value - The value for structure
      Returns:
      A modified copy or this if not changed
    • withStructure

      public final ImmutableSimpleExtension.Type withStructure(Optional<? extends Object> optional)
      Copy the current immutable object by setting an optional value for the structure attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for structure
      Returns:
      A modified copy or this if not changed
    • withParameters

      public final ImmutableSimpleExtension.Type withParameters(List<Object> value)
      Copy the current immutable object by setting a present value for the optional parameters attribute.
      Parameters:
      value - The value for parameters
      Returns:
      A modified copy or this if not changed
    • withParameters

      public final ImmutableSimpleExtension.Type withParameters(Optional<? extends List<Object>> optional)
      Copy the current immutable object by setting an optional value for the parameters attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for parameters
      Returns:
      A modified copy or this if not changed
    • withVariadic

      public final ImmutableSimpleExtension.Type withVariadic(boolean value)
      Copy the current immutable object by setting a present value for the optional variadic attribute.
      Parameters:
      value - The value for variadic
      Returns:
      A modified copy or this if not changed
    • withVariadic

      public final ImmutableSimpleExtension.Type withVariadic(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the variadic attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for variadic
      Returns:
      A modified copy or this if not changed
    • withMetadata

      public final ImmutableSimpleExtension.Type withMetadata(Map<String,Object> value)
      Copy the current immutable object by setting a present value for the optional metadata attribute.
      Parameters:
      value - The value for metadata
      Returns:
      A modified copy or this if not changed
    • withMetadata

      public final ImmutableSimpleExtension.Type withMetadata(Optional<? extends Map<String,Object>> optional)
      Copy the current immutable object by setting an optional value for the metadata attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for metadata
      Returns:
      A modified copy or this if not changed
    • equals

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

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

      public static ImmutableSimpleExtension.Type copyOf(SimpleExtension.Type instance)
      Creates an immutable copy of a SimpleExtension.Type 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 Type instance
    • builder

      public static ImmutableSimpleExtension.Type.Builder builder()
      Creates a builder for Type.
       ImmutableSimpleExtension.Type.builder()
          .name(String) // required name
          .description(Optional<String>) // optional description
          .urn(String) // required urn
          .structure(Optional<Object>) // optional structure
          .parameters(Optional<List<Object>>) // optional parameters
          .variadic(Optional<Boolean>) // optional variadic
          .metadata(Optional<Map<String, Object>>) // optional metadata
          .build();
       
      Returns:
      A new Type builder