Class FunctionMethod

  • All Implemented Interfaces:
    Serializable

    public class FunctionMethod
    extends AbstractMetadataRecord

    This class represents information about a particular function signature. Function signatures are unique with respect to their name, # of arguments, and type of arguments. Return type and argument names are not uniqueness factors. This class makes no attempt to validate the data put into it, particularly with respect to null values. Attributes:

    • name - Name of the function
    • description - Description of the function
    • category - Function category containing this function
    • pushdown - Determine whether this function can, cannot, or must be pushed down to a source
    • invocationClass - Class containing method implementing this function
    • invocationMethod - Method implementing this function
    • inputParameters - 0 or more input parameters
    • outputParameter - 1 output parameter
    • determinism - specifies whether the function is deterministic or not. Various levels are provided
    • nullOnNull - Specifies whether the function is called if any of the input arguments is null. The result is the null value.
    See Also:
    FunctionParameter, Serialized Form
    • Method Detail

      • getDescription

        public String getDescription()
        Get description of method
        Returns:
        Description
      • setDescription

        public void setDescription​(String description)
        Set description of method
        Parameters:
        description - Description
      • getCategory

        public String getCategory()
        Get category of method
        Returns:
        Category
      • setCategory

        public void setCategory​(String category)
        Set category of method
        Parameters:
        category - Category
      • getPushdown

        public FunctionMethod.PushDown getPushdown()
        Get pushdown property of method
        Returns:
        One of the FunctionMethod constants for pushdown
      • setPushdown

        public void setPushdown​(FunctionMethod.PushDown pushdown)
        Set pushdown property of method
        Parameters:
        pushdown - One of the FunctionMethod constants for pushdown
      • setPushDown

        public void setPushDown​(String pushdown)
      • getInvocationClass

        public String getInvocationClass()
        Get invocation class name
        Returns:
        Invocation class name
      • setInvocationClass

        public void setInvocationClass​(String invocationClass)
        Set invocation class name
        Parameters:
        invocationClass - Invocation class name
      • getInvocationMethod

        public String getInvocationMethod()
        Get invocation method name
        Returns:
        Invocation method name
      • setInvocationMethod

        public void setInvocationMethod​(String invocationMethod)
        Set invocation method name
        Parameters:
        invocationMethod - Invocation method name
      • getInputParameterCount

        public int getInputParameterCount()
        Get a count of the input parameters.
        Returns:
        Number of input parameters
      • getInputParameters

        public List<FunctionParameter> getInputParameters()
        Get input parameters
        Returns:
        Array of input parameters, may be null if 0 parameters
      • setInputParameters

        public void setInputParameters​(List<FunctionParameter> params)
        Set input parameters.
        Parameters:
        params - Input parameters
      • getOutputParameter

        public FunctionParameter getOutputParameter()
        Get output/return parameter.
        Returns:
        Output parameter or return argument
      • setOutputParameter

        public void setOutputParameter​(FunctionParameter param)
        Set output/return parameter.
        Parameters:
        param - Output Parameter
      • hashCode

        public int hashCode()
        Get hash code for this object. The hash code is based on the name and input parameters. WARNING: Changing the name or input parameters will change the hash code. If this occurs after the object has been placed in a HashSet or HashMap, the object will be lost!!!! In that case, the object must be added to the hashed collection again.
        Overrides:
        hashCode in class AbstractMetadataRecord
        Returns:
        Hash code, based on name and input parameters
      • equals

        public boolean equals​(Object obj)
        Compare other object for equality. This object is equal to another FunctionMethod if 1) Name of function matches (case-insensitive), 2) number of input parameters matches and 3) types of input parameters match.
        Overrides:
        equals in class AbstractMetadataRecord
        Returns:
        True if object equals this object according to conditions
      • toString

        public String toString()
        Return string version for debugging purposes
        Overrides:
        toString in class AbstractMetadataRecord
        Returns:
        String representation of function method
      • isNullOnNull

        public boolean isNullOnNull()
        Returns true if the function returns null on any null input
      • setNullOnNull

        public void setNullOnNull​(boolean nullOnNull)
      • setDeterministicBoolean

        public void setDeterministicBoolean​(boolean deterministic)
      • isVarArgs

        public boolean isVarArgs()
      • setVarArgs

        public boolean setVarArgs​(boolean varargs)
        Parameters:
        varargs -
        Returns:
        true if the value was successfully set.
      • setParent

        public void setParent​(Schema parent)
      • getAggregateAttributes

        public AggregateAttributes getAggregateAttributes()
        Gets the AggregateAttributes for this function if it represents an aggregate function. Must be null for non-aggregates.
        Returns:
      • setAggregateAttributes

        public void setAggregateAttributes​(AggregateAttributes aggregateAttributes)
      • convertExtensionMetadata

        public static void convertExtensionMetadata​(Procedure procedureRecord,
                                                    FunctionMethod function)
      • getMethod

        public Method getMethod()
      • setMethod

        public void setMethod​(Method method)