Package io.substrait.hint
Class ImmutableHint
java.lang.Object
io.substrait.hint.Hint
io.substrait.hint.ImmutableHint
- All Implemented Interfaces:
HasExtension
Immutable implementation of
Hint.
Use the builder to create immutable instances:
ImmutableHint.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.substrait.hint.Hint
Hint.ComputationType, Hint.LoadedComputation, Hint.RuntimeConstraint, Hint.SavedComputation, Hint.Stats -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableHint.Builderbuilder()Creates a builder forImmutableHint.static ImmutableHintCreates an immutable copy of aHintvalue.booleanThis instance is equal to all instances ofImmutableHintthat have equal attribute values.getAlias()getStats()inthashCode()Computes a hash code from attributes:extension,alias,outputNames,stats,runtimeConstraint,loadedComputations,savedComputations.toString()Prints the immutable valueHintwith attribute values.final ImmutableHintCopy the current immutable object by setting a present value for the optionalaliasattribute.final ImmutableHintCopy the current immutable object by setting an optional value for thealiasattribute.final ImmutableHintwithExtension(AdvancedExtension value) Copy the current immutable object by setting a present value for the optionalextensionattribute.final ImmutableHintwithExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theextensionattribute.final ImmutableHintwithLoadedComputations(Hint.LoadedComputation... elements) Copy the current immutable object with elements that replace the content ofloadedComputations.final ImmutableHintwithLoadedComputations(Iterable<? extends Hint.LoadedComputation> elements) Copy the current immutable object with elements that replace the content ofloadedComputations.final ImmutableHintwithOutputNames(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofoutputNames.final ImmutableHintwithOutputNames(String... elements) Copy the current immutable object with elements that replace the content ofoutputNames.final ImmutableHintCopy the current immutable object by setting a present value for the optionalruntimeConstraintattribute.final ImmutableHintwithRuntimeConstraint(Optional<? extends Hint.RuntimeConstraint> optional) Copy the current immutable object by setting an optional value for theruntimeConstraintattribute.final ImmutableHintwithSavedComputations(Hint.SavedComputation... elements) Copy the current immutable object with elements that replace the content ofsavedComputations.final ImmutableHintwithSavedComputations(Iterable<? extends Hint.SavedComputation> elements) Copy the current immutable object with elements that replace the content ofsavedComputations.final ImmutableHintwithStats(Hint.Stats value) Copy the current immutable object by setting a present value for the optionalstatsattribute.final ImmutableHintwithStats(Optional<? extends Hint.Stats> optional) Copy the current immutable object by setting an optional value for thestatsattribute.
-
Method Details
-
getExtension
- Returns:
- the
AdvancedExtensionassociated directly with the class
-
getAlias
-
getOutputNames
- Specified by:
getOutputNamesin classHint- Returns:
- The value of the
outputNamesattribute
-
getStats
-
getRuntimeConstraint
- Specified by:
getRuntimeConstraintin classHint- Returns:
- The value of the
runtimeConstraintattribute
-
getLoadedComputations
- Specified by:
getLoadedComputationsin classHint- Returns:
- The value of the
loadedComputationsattribute
-
getSavedComputations
- Specified by:
getSavedComputationsin classHint- Returns:
- The value of the
savedComputationsattribute
-
withExtension
Copy the current immutable object by setting a present value for the optionalextensionattribute.- Parameters:
value- The value for extension- Returns:
- A modified copy or
thisif not changed
-
withExtension
Copy the current immutable object by setting an optional value for theextensionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for extension- Returns:
- A modified copy or
thisif not changed
-
withAlias
Copy the current immutable object by setting a present value for the optionalaliasattribute.- Parameters:
value- The value for alias- Returns:
- A modified copy or
thisif not changed
-
withAlias
Copy the current immutable object by setting an optional value for thealiasattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for alias- Returns:
- A modified copy or
thisif not changed
-
withOutputNames
Copy the current immutable object with elements that replace the content ofoutputNames.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withOutputNames
Copy the current immutable object with elements that replace the content ofoutputNames. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of outputNames elements to set- Returns:
- A modified copy or
thisif not changed
-
withStats
Copy the current immutable object by setting a present value for the optionalstatsattribute.- Parameters:
value- The value for stats- Returns:
- A modified copy or
thisif not changed
-
withStats
Copy the current immutable object by setting an optional value for thestatsattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for stats- Returns:
- A modified copy or
thisif not changed
-
withRuntimeConstraint
Copy the current immutable object by setting a present value for the optionalruntimeConstraintattribute.- Parameters:
value- The value for runtimeConstraint- Returns:
- A modified copy or
thisif not changed
-
withRuntimeConstraint
public final ImmutableHint withRuntimeConstraint(Optional<? extends Hint.RuntimeConstraint> optional) Copy the current immutable object by setting an optional value for theruntimeConstraintattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for runtimeConstraint- Returns:
- A modified copy or
thisif not changed
-
withLoadedComputations
Copy the current immutable object with elements that replace the content ofloadedComputations.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withLoadedComputations
public final ImmutableHint withLoadedComputations(Iterable<? extends Hint.LoadedComputation> elements) Copy the current immutable object with elements that replace the content ofloadedComputations. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of loadedComputations elements to set- Returns:
- A modified copy or
thisif not changed
-
withSavedComputations
Copy the current immutable object with elements that replace the content ofsavedComputations.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSavedComputations
public final ImmutableHint withSavedComputations(Iterable<? extends Hint.SavedComputation> elements) Copy the current immutable object with elements that replace the content ofsavedComputations. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of savedComputations elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableHintthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:extension,alias,outputNames,stats,runtimeConstraint,loadedComputations,savedComputations. -
toString
Prints the immutable valueHintwith attribute values. -
copyOf
Creates an immutable copy of aHintvalue. 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 Hint instance
-
builder
Creates a builder forImmutableHint.ImmutableHint.builder() .extension(Optional<io.substrait.extension.AdvancedExtension>) // optionalextension.alias(Optional<String>) // optionalalias.addOutputNames|addAllOutputNames(String) //outputNameselements .stats(Optional<io.substrait.hint.Hint.Stats>) // optionalstats.runtimeConstraint(Optional<io.substrait.hint.Hint.RuntimeConstraint>) // optionalruntimeConstraint.addLoadedComputations|addAllLoadedComputations(io.substrait.hint.Hint.LoadedComputation) //loadedComputationselements .addSavedComputations|addAllSavedComputations(io.substrait.hint.Hint.SavedComputation) //savedComputationselements .build();- Returns:
- A new ImmutableHint builder
-