@Internal public final class SubsequenceInputTypeStrategy extends Object implements InputTypeStrategy
InputTypeStrategy
that lets you apply other strategies for subsequences of the actual
arguments.
The SequenceInputTypeStrategy
should be preferred in most of the cases. Use this
strategy only if you need to apply a common logic to a subsequence of the arguments.
Modifier and Type | Class and Description |
---|---|
static class |
SubsequenceInputTypeStrategy.SubsequenceStrategyBuilder
A Builder for
SubsequenceInputTypeStrategy . |
Modifier and Type | Method and Description |
---|---|
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.
|
Optional<List<DataType>> |
inferInputTypes(CallContext callContext,
boolean throwOnFailure)
Main logic for inferring and validating the input arguments.
|
public ArgumentCount getArgumentCount()
InputTypeStrategy
getArgumentCount
in interface InputTypeStrategy
public Optional<List<DataType>> inferInputTypes(CallContext callContext, boolean throwOnFailure)
InputTypeStrategy
CallContext.getArgumentDataTypes()
, a casting operation can be inserted. An empty result
means that the given input is invalid.inferInputTypes
in interface InputTypeStrategy
callContext
- 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)
InputTypeStrategy
getExpectedSignatures
in interface InputTypeStrategy
definition
- the function definition that defines the function currently being called.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.