AbstractFunction (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.cql3.functions

## Class AbstractFunction

- java.lang.Object
- - org.apache.cassandra.cql3.functions.AbstractFunction

- All Implemented Interfaces:
    AssignmentTestable, Function
  Direct Known Subclasses:
    NativeFunction, UDAggregate, UDFunction

      public abstract class AbstractFunction
      extends java.lang.Object
      implements Function

  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
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.List<AbstractType<?>>` | `argTypes`
    `protected FunctionName` | `name`
    `protected AbstractType<?>` | `returnType`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractFunction(FunctionName name, java.util.List<AbstractType<?>> argTypes, AbstractType<?> returnType)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<AbstractType<?>>` | `argTypes()`
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.Iterable<Function>` | `getFunctions()`
    `int` | `hashCode()`
    `boolean` | `hasReferenceTo(Function function)`
    `FunctionName` | `name()`
    `AbstractType<?>` | `returnType()`
    `AssignmentTestable.TestResult` | `testAssignment(java.lang.String keyspace, ColumnSpecification receiver)`
    `java.lang.String` | `toString()`

    - ### 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

      `isAggregate, isNative`

- - ### Field Detail

    - #### name

          protected final FunctionName name

    - #### argTypes

          protected final java.util.List<AbstractType<?>> argTypes

    - #### returnType

          protected final AbstractType<?> returnType

  - ### Constructor Detail

    - #### AbstractFunction

          protected AbstractFunction(FunctionName name,
                                     java.util.List<AbstractType<?>> argTypes,
                                     AbstractType<?> returnType)

  - ### Method Detail

    - #### name

          public FunctionName name()

      Specified by:
        `name` in interface `Function`

    - #### argTypes

          public java.util.List<AbstractType<?>> argTypes()

      Specified by:
        `argTypes` in interface `Function`

    - #### returnType

          public AbstractType<?> returnType()

      Specified by:
        `returnType` in interface `Function`

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### getFunctions

          public java.lang.Iterable<Function> getFunctions()

      Specified by:
        `getFunctions` in interface `Function`

    - #### hasReferenceTo

          public boolean hasReferenceTo(Function function)

      Specified by:
        `hasReferenceTo` in interface `Function`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### testAssignment

          public final AssignmentTestable.TestResult testAssignment(java.lang.String keyspace,
                                                                    ColumnSpecification receiver)

      Specified by:
        `testAssignment` in interface `AssignmentTestable`
      Returns:
        whether this object can be assigned to the provided receiver. We distinguish between 3 values: - EXACT_MATCH if this object is exactly of the type expected by the receiver - WEAKLY_ASSIGNABLE if this object is not exactly the expected type but is assignable nonetheless - NOT_ASSIGNABLE if it's not assignable Most caller should just call the isAssignable() method on the result, though functions have a use for testing "strong" equality to decide the most precise overload to pick when multiple could match.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2018 The Apache Software Foundation