UDFContext (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.cql3.functions

## Interface UDFContext

- All Known Implementing Classes:
    UDFContextImpl

      public interface UDFContext

  Provides context information for a particular user defined function. Java UDFs can access implementations of this interface using the `udfContext` field, scripted UDFs can get it using the `udfContext` binding.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.datastax.driver.core.TupleValue` | `newArgTupleValue(int argNum)` Creates a new `TupleValue` instance for an argument.
    `com.datastax.driver.core.TupleValue` | `newArgTupleValue(java.lang.String argName)` Creates a new `TupleValue` instance for an argument.
    `com.datastax.driver.core.UDTValue` | `newArgUDTValue(int argNum)` Creates a new `UDTValue` instance for an argument.
    `com.datastax.driver.core.UDTValue` | `newArgUDTValue(java.lang.String argName)` Creates a new `UDTValue` instance for an argument.
    `com.datastax.driver.core.TupleValue` | `newReturnTupleValue()` Creates a new `TupleValue` instance for the return value.
    `com.datastax.driver.core.UDTValue` | `newReturnUDTValue()` Creates a new `UDTValue` instance for the return value.
    `com.datastax.driver.core.TupleValue` | `newTupleValue(java.lang.String cqlDefinition)` Creates a new `TupleValue` instance for the CQL type definition.
    `com.datastax.driver.core.UDTValue` | `newUDTValue(java.lang.String udtName)` Creates a new `UDTValue` instance by name in the same keyspace.

- - ### Method Detail

    - #### newArgUDTValue

          com.datastax.driver.core.UDTValue newArgUDTValue(java.lang.String argName)

      Creates a new `UDTValue` instance for an argument.
      Parameters:
        `argName` - name of the argument as declared in the `CREATE FUNCTION` statement
      Returns:
        a new `UDTValue` instance
      Throws:
        `java.lang.IllegalArgumentException` - if no argument for the given name exists
        `java.lang.IllegalStateException` - if the argument is not a UDT

    - #### newArgUDTValue

          com.datastax.driver.core.UDTValue newArgUDTValue(int argNum)

      Creates a new `UDTValue` instance for an argument.
      Parameters:
        `argNum` - zero-based index of the argument as declared in the `CREATE FUNCTION` statement
      Returns:
        a new `UDTValue` instance
      Throws:
        `java.lang.ArrayIndexOutOfBoundsException` - if no argument for the given index exists
        `java.lang.IllegalStateException` - if the argument is not a UDT

    - #### newReturnUDTValue

          com.datastax.driver.core.UDTValue newReturnUDTValue()

      Creates a new `UDTValue` instance for the return value.
      Returns:
        a new `UDTValue` instance
      Throws:
        `java.lang.IllegalStateException` - if the return type is not a UDT

    - #### newUDTValue

          com.datastax.driver.core.UDTValue newUDTValue(java.lang.String udtName)

      Creates a new `UDTValue` instance by name in the same keyspace.
      Parameters:
        `udtName` - name of the user defined type in the same keyspace as the function
      Returns:
        a new `UDTValue` instance
      Throws:
        `java.lang.IllegalArgumentException` - if no UDT for the given name exists

    - #### newArgTupleValue

          com.datastax.driver.core.TupleValue newArgTupleValue(java.lang.String argName)

      Creates a new `TupleValue` instance for an argument.
      Parameters:
        `argName` - name of the argument as declared in the `CREATE FUNCTION` statement
      Returns:
        a new `TupleValue` instance
      Throws:
        `java.lang.IllegalArgumentException` - if no argument for the given name exists
        `java.lang.IllegalStateException` - if the argument is not a tuple

    - #### newArgTupleValue

          com.datastax.driver.core.TupleValue newArgTupleValue(int argNum)

      Creates a new `TupleValue` instance for an argument.
      Parameters:
        `argNum` - zero-based index of the argument as declared in the `CREATE FUNCTION` statement
      Returns:
        a new `TupleValue` instance
      Throws:
        `java.lang.ArrayIndexOutOfBoundsException` - if no argument for the given index exists
        `java.lang.IllegalStateException` - if the argument is not a tuple

    - #### newReturnTupleValue

          com.datastax.driver.core.TupleValue newReturnTupleValue()

      Creates a new `TupleValue` instance for the return value.
      Returns:
        a new `TupleValue` instance
      Throws:
        `java.lang.IllegalStateException` - if the return type is not a tuple

    - #### newTupleValue

          com.datastax.driver.core.TupleValue newTupleValue(java.lang.String cqlDefinition)

      Creates a new `TupleValue` instance for the CQL type definition.
      Parameters:
        `cqlDefinition` - CQL tuple type definition like `tuple<int, text, bigint>`
      Returns:
        a new `TupleValue` instance
      Throws:
        `java.lang.IllegalStateException` - if cqlDefinition type is not a tuple or an invalid type

Copyright © 2018 The Apache Software Foundation