Class NativeFunction
- java.lang.Object
-
- org.apache.cassandra.cql3.functions.AbstractFunction
-
- org.apache.cassandra.cql3.functions.NativeFunction
-
- All Implemented Interfaces:
AssignmentTestable
,Function
- Direct Known Subclasses:
NativeAggregateFunction
,NativeScalarFunction
public abstract class NativeFunction extends AbstractFunction
Base class for our native/hardcoded functions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.cql3.functions.AbstractFunction
argTypes, name, returnType
-
Fields inherited from interface org.apache.cassandra.cql3.functions.Function
UNRESOLVED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NativeFunction(java.lang.String name, AbstractType<?> returnType, AbstractType<?>... argTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isNative()
Checks whether the function is a native/hard coded one or not.boolean
isPure()
Checks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not.Arguments
newArguments(ProtocolVersion version)
Creates some new input arguments for this function.NativeFunction
withLegacyName()
Returns a copy of this function using its old pre-5.0 name before the adoption of snake-cased function names.-
Methods inherited from class org.apache.cassandra.cql3.functions.AbstractFunction
addFunctionsTo, argTypes, argumentsList, columnName, elementKeyspace, elementName, equals, getCompatibleTypeIfKnown, hashCode, name, referencesUserType, returnType, testAssignment, toCqlString, toString, typesMatch
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.functions.Function
compare, isAggregate
-
-
-
-
Constructor Detail
-
NativeFunction
protected NativeFunction(java.lang.String name, AbstractType<?> returnType, AbstractType<?>... argTypes)
-
-
Method Detail
-
isNative
public final boolean isNative()
Description copied from interface:Function
Checks whether the function is a native/hard coded one or not.- Returns:
true
if the function is a native/hard coded one,false
otherwise.
-
isPure
public boolean isPure()
Description copied from interface:Function
Checks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not.- Returns:
true
if the function is a pure function,false
otherwise.
-
withLegacyName
@Nullable public NativeFunction withLegacyName()
Returns a copy of this function using its old pre-5.0 name before the adoption of snake-cased function names. Those naming conventions were adopted in 5.0, but we still need to support the old names for compatibility. See CASSANDRA-18037 for further details.- Returns:
- a copy of this function using its old pre-5.0 deprecated name, or
null
if the pre-5.0 function name already satisfied the naming conventions.
-
newArguments
public Arguments newArguments(ProtocolVersion version)
Description copied from interface:Function
Creates some new input arguments for this function.- Parameters:
version
- the protocol version- Returns:
- some new input arguments for this function
-
-