@Internal public final class OrInputTypeStrategy extends Object implements InputTypeStrategy
InputTypeStrategys into one like f(NUMERIC) || f(STRING).
This strategy aims to infer a list of types that are equal to the input types (to prevent unnecessary casting) or (if this is not possible) the first more specific, casted types.
| Constructor and Description |
|---|
OrInputTypeStrategy(List<? extends InputTypeStrategy> inputStrategies) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
ArgumentCount |
getArgumentCount()
Initial input validation based on the number of arguments.
|
List<Signature> |
getExpectedSignatures(FunctionDefinition definition)
Returns a summary of the function's expected signatures.
|
int |
hashCode() |
Optional<List<DataType>> |
inferInputTypes(CallContext callContext,
boolean throwOnFailure)
Main logic for inferring and validating the input arguments.
|
public OrInputTypeStrategy(List<? extends InputTypeStrategy> inputStrategies)
public ArgumentCount getArgumentCount()
InputTypeStrategygetArgumentCount in interface InputTypeStrategypublic Optional<List<DataType>> inferInputTypes(CallContext callContext, boolean throwOnFailure)
InputTypeStrategyCallContext.getArgumentDataTypes(), a casting operation can be inserted. An empty result
means that the given input is invalid.inferInputTypes in interface InputTypeStrategycallContext - provides details about the function callthrowOnFailure - whether this function is allowed to throw an ValidationException with a meaningful exception in case the inference is not successful
or if this function should simply return an empty result.CallContext.newValidationError(String, Object...)public List<Signature> getExpectedSignatures(FunctionDefinition definition)
InputTypeStrategygetExpectedSignatures in interface InputTypeStrategydefinition - the function definition that defines the function currently being called.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.