Interface Function

All Superinterfaces:
Cloneable, com.streambase.sb.internal.CloneableData

public interface Function extends Cloneable, com.streambase.sb.internal.CloneableData
Represents a value of type StreamBase Function.
Since:
7.4
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(Tuple input)
    Applies the given arguments to this function and returns the output.
    apply(Object... args)
    Applies the given arguments to this function and returns the output.
    Returns Schema for the input argument types of the function.
    Returns a string with the StreamBase expression that is the body of this function.
    Returns the name of this function.
    Returns the CompleteDataType for the function's return type.
    Returns a string with the StreamBase expression that creates this function.
    boolean
    If function cacheable?

    Methods inherited from interface com.streambase.sb.internal.CloneableData

    clone
  • Method Details

    • isCacheable

      boolean isCacheable()
      If function cacheable?
      Returns:
      true if cacheable
    • getArgumentSchema

      Schema getArgumentSchema()
      Returns Schema for the input argument types of the function. The schema will contain fields for the input arguments of the function in the same exact order as in the function declaration.
      Returns:
      Schema representing the input argument types of the function
    • getReturnType

      CompleteDataType getReturnType()
      Returns the CompleteDataType for the function's return type.
      Returns:
      CompleteDataType for the function's return type
    • getBody

      String getBody()

      Returns a string with the StreamBase expression that is the body of this function.

      Eg., For this function "function (arg0 int, arg1) → int { arg0 + arg1 }" getBody() would return "arg0 + arg1"

      Returns:
      Returns a string with the StreamBase expression is the body of this function.
    • getStringRep

      String getStringRep()

      Returns a string with the StreamBase expression that creates this function.

      Eg., For this function "function (arg0 int, arg1) → int { arg0 + arg1 }" getStringRep() would return "function (arg0 int, arg1) → int { arg0 + arg1 }"

      Returns:
      Returns a string with the StreamBase expression that creates this function.
    • getName

      String getName()
      Returns the name of this function. Null if this has no name.
      Returns:
      name of this function. Null if this has no name.
    • apply

      Object apply(Tuple input) throws StreamBaseException
      Applies the given arguments to this function and returns the output. This method takes in the input arguments as field values in a Tuple with the same schema as the function's input argument schema.
      Parameters:
      input - Tuple whose schema is the same as this function's input argument schema. The field values must be the input values that should be applied to this function.
      Returns:
      value returned by this function for the given input arguments
      Throws:
      StreamBaseException - if any unexpected error occurs
    • apply

      Object apply(Object... args) throws StreamBaseException
      Applies the given arguments to this function and returns the output. The supplied arguments should be in the same order as the function's input arguments. If the number of arguments supplied is less than the number of arguments in the function definition, the values will be set for the first 'n' input arguments of the function.
      Parameters:
      args - Array of arguments that are to be applied to the function
      Returns:
      value returned by this function for the given input arguments
      Throws:
      StreamBaseException - if any unexpected error occurs