Class IFunction.Builder

java.lang.Object
dev.metaschema.core.metapath.function.IFunction.Builder
Enclosing interface:
IFunction

public static final class IFunction.Builder extends Object
Used to create a function's signature using a builder pattern.
  • Method Details

    • name

      @NonNull public IFunction.Builder name(@NonNull String name)
      Define the name of the function.
      Parameters:
      name - the function's name
      Returns:
      this builder
    • namespace

      @NonNull public IFunction.Builder namespace(@NonNull String name)
      Define the namespace of the function.
      Parameters:
      name - the function's namespace URI as a string
      Returns:
      this builder
    • deterministic

      @NonNull public IFunction.Builder deterministic()
      Mark the function as deterministic.
      Returns:
      this builder
      See Also:
    • nonDeterministic

      @NonNull public IFunction.Builder nonDeterministic()
      Mark the function as non-deterministic.
      Returns:
      this builder
      See Also:
    • contextDependent

      @NonNull public IFunction.Builder contextDependent()
      Mark the function as context dependent.
      Returns:
      this builder
      See Also:
    • contextIndependent

      @NonNull public IFunction.Builder contextIndependent()
      Mark the function as context independent.
      Returns:
      this builder
      See Also:
    • focusDependent

      @NonNull public IFunction.Builder focusDependent()
      Mark the function as focus dependent.
      Returns:
      this builder
      See Also:
    • focusIndependent

      @NonNull public IFunction.Builder focusIndependent()
      Mark the function as focus independent.
      Returns:
      this builder
      See Also:
    • allowUnboundedArity

      @NonNull public IFunction.Builder allowUnboundedArity(boolean allow)
      Indicate if the last argument can be repeated.
      Parameters:
      allow - if true then the the last argument can be repeated an unlimited number of times, or false otherwise
      Returns:
      this builder
    • returnType

      @NonNull public IFunction.Builder returnType(@NonNull String name)
      Define the return sequence Java type of the function.
      Parameters:
      name - the extended qualified name of the function's return data type
      Returns:
      this builder
    • returnType

      @NonNull public IFunction.Builder returnType(@NonNull IEnhancedQName name)
      Define the return sequence Java type of the function.
      Parameters:
      name - the qualified name of the function's return data type
      Returns:
      this builder
    • returnType

      @NonNull public IFunction.Builder returnType(@NonNull IItemType type)
      Define the return sequence Java type of the function.
      Parameters:
      type - the function's return Java type
      Returns:
      this builder
    • returnZeroOrOne

      @NonNull public IFunction.Builder returnZeroOrOne()
      Indicate the sequence returned will contain zero or one items.
      Returns:
      this builder
    • returnOne

      @NonNull public IFunction.Builder returnOne()
      Indicate the sequence returned will contain one item.
      Returns:
      this builder
    • returnZeroOrMore

      @NonNull public IFunction.Builder returnZeroOrMore()
      Indicate the sequence returned will contain zero or more items.
      Returns:
      this builder
    • returnOneOrMore

      @NonNull public IFunction.Builder returnOneOrMore()
      Indicate the sequence returned will contain one or more items.
      Returns:
      this builder
    • argument

      @NonNull public IFunction.Builder argument(@NonNull IArgument.Builder builder)
      Add an argument based on the provided builder.
      Parameters:
      builder - the argument builder
      Returns:
      this builder
    • argument

      @NonNull public IFunction.Builder argument(@NonNull IArgument argument)
      Add an argument based on the provided argument signature.
      Parameters:
      argument - the argument
      Returns:
      this builder
    • functionHandler

      @NonNull public IFunction.Builder functionHandler(@NonNull IFunctionExecutor handler)
      Specify the static function to call when executing the function.
      Parameters:
      handler - a method implementing the IFunctionExecutor functional interface
      Returns:
      this builder
    • build

      @NonNull public IFunction build()
      Builds the function's signature.
      Returns:
      the function's signature