Package io.substrait.extension
Class ImmutableSimpleExtension.Option
java.lang.Object
io.substrait.extension.ImmutableSimpleExtension.Option
- All Implemented Interfaces:
SimpleExtension.Option
- Enclosing class:
- ImmutableSimpleExtension
public static final class ImmutableSimpleExtension.Option
extends Object
implements SimpleExtension.Option
Immutable implementation of
SimpleExtension.Option.
Use the builder to create immutable instances:
ImmutableSimpleExtension.Option.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forOption.copyOf(SimpleExtension.Option instance) Creates an immutable copy of aSimpleExtension.Optionvalue.booleanThis instance is equal to all instances ofOptionthat have equal attribute values.inthashCode()Computes a hash code from attributes:description,values.toString()Prints the immutable valueOptionwith attribute values.withDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.withDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.withValues(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofvalues.withValues(String... elements) Copy the current immutable object with elements that replace the content ofvalues.
-
Method Details
-
getDescription
- Specified by:
getDescriptionin interfaceSimpleExtension.Option- Returns:
- The value of the
descriptionattribute
-
getValues
- Specified by:
getValuesin interfaceSimpleExtension.Option- Returns:
- The value of the
valuesattribute
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescriptionattribute.- Parameters:
value- The value for description- Returns:
- A modified copy or
thisif not changed
-
withDescription
Copy the current immutable object by setting an optional value for thedescriptionattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for description- Returns:
- A modified copy or
thisif not changed
-
withValues
Copy the current immutable object with elements that replace the content ofvalues.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withValues
Copy the current immutable object with elements that replace the content ofvalues. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of values elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofOptionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:description,values. -
toString
Prints the immutable valueOptionwith attribute values. -
copyOf
Creates an immutable copy of aSimpleExtension.Optionvalue. 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 Option instance
-
builder
Creates a builder forOption.ImmutableSimpleExtension.Option.builder() .description(Optional<String>) // optionaldescription.addValues|addAllValues(String) //valueselements .build();- Returns:
- A new Option builder
-