Interface FunctionParameter
public interface FunctionParameter
Generic, loose definition of a function parameter, able to infer the specific data type of the parameter in the
function specifically built by a
FunctionFactory for a particular function call.-
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionParameterstatic FunctionParameteranyMap()static FunctionParameteranyType(boolean inferFromReceiver) static FunctionParameterdefault AbstractType<?>inferType(String keyspace, AssignmentTestable arg, AbstractType<?> receiverType, List<AbstractType<?>> inferredTypes) Tries to infer the data type of the parameter for an argument in a call to the function.default booleanstatic FunctionParameterstatic FunctionParameteroptional(FunctionParameter wrapped) static FunctionParametersameAs(int index, boolean preferOther, FunctionParameter parameter) static FunctionParameterstatic FunctionParameterstring()voidvalidateType(FunctionName name, AssignmentTestable arg, AbstractType<?> argType) static FunctionParameter
-
Method Details
-
inferType
@Nullable default AbstractType<?> inferType(String keyspace, AssignmentTestable arg, @Nullable AbstractType<?> receiverType, @Nullable List<AbstractType<?>> inferredTypes) Tries to infer the data type of the parameter for an argument in a call to the function.- Parameters:
keyspace- the current keyspacearg- a parameter value in a specific function callreceiverType- the type of the object that will receive the result of the function callinferredTypes- the types that have been inferred for the other parameters- Returns:
- the inferred data type of the parameter, or {@link null} it isn't possible to infer it
-
validateType
-
isOptional
default boolean isOptional()- Returns:
- whether this parameter is optional
-
optional
- Parameters:
wrapped- the wrapped parameter- Returns:
- a function parameter definition that accepts the specified wrapped parameter, considering it optional as
defined by
isOptional().
-
string
- Returns:
- a function parameter definition that accepts values of string-based data types (text, varchar and ascii)
-
fixed
- Parameters:
types- the accepted data types- Returns:
- a function parameter definition that accepts values of a specific data type
-
anyType
- Parameters:
inferFromReceiver- whether the parameter should try to use the function receiver to infer its data type- Returns:
- a function parameter definition that accepts columns of any data type
-
sameAs
- Parameters:
index- the index of the function argument that this parameter is associated withpreferOther- whether the parameter should prefer the type of the other parameter over its own typeparameter- the type of this parameter when the type of the associated parameter is unknown- Returns:
- a function parameter definition that is expected to have the same type as another parameter
-
anyCollection
- Returns:
- a function parameter definition that accepts values of type
CollectionType, independently of the types of its elements.
-
setOrList
-
numericSetOrList
-
anyMap
- Returns:
- a function parameter definition that accepts values of type
MapType, independently of the types of the map keys and values.
-
vector
- Parameters:
type- the type of the vector elements- Returns:
- a function parameter definition that accepts values of type
VectorTypewith elements of the specifiedtypeand any dimensions.
-