Interface DefaultFunction.Builder<T>
- Type Parameters:
T
- The return type of the function.
- Enclosing interface:
DefaultFunction<T>
public static interface DefaultFunction.Builder<T>
Represents a builder for
DefaultFunctions
.-
Method Summary
Modifier and TypeMethodDescriptionbuild
(Function<FunctionArguments, T> execute) Completes this builder with the code to execute on call of this function.Sets this function builder'sContract
.description
(@NotNull String @NotNull ... description) Sets this function builder's description.Sets this function builder's examples.Sets this function builder's keywords.parameter
(@NotNull String name, @NotNull Class<?> type, Parameter.Modifier @NotNull ... modifiers) Adds a parameter to this function builder.Sets this function builder's requires.Sets this function builder's version history.
-
Method Details
-
contract
Sets this function builder'sContract
.- Parameters:
contract
- The contract.- Returns:
- This builder.
-
description
@Contract("_ -> this") DefaultFunction.Builder<T> description(@NotNull @NotNull String @NotNull ... description) Sets this function builder's description.- Parameters:
description
- The description.- Returns:
- This builder.
-
since
@Contract("_ -> this") DefaultFunction.Builder<T> since(@NotNull @NotNull String @NotNull ... since) Sets this function builder's version history.- Parameters:
since
- The version information.- Returns:
- This builder.
-
examples
@Contract("_ -> this") DefaultFunction.Builder<T> examples(@NotNull @NotNull String @NotNull ... examples) Sets this function builder's examples.- Parameters:
examples
- The examples.- Returns:
- This builder.
-
keywords
@Contract("_ -> this") DefaultFunction.Builder<T> keywords(@NotNull @NotNull String @NotNull ... keywords) Sets this function builder's keywords.- Parameters:
keywords
- The keywords.- Returns:
- This builder.
-
requires
@Contract("_ -> this") DefaultFunction.Builder<T> requires(@NotNull @NotNull String @NotNull ... requires) Sets this function builder's requires.- Parameters:
requires
- The requirements.- Returns:
- This builder.
-
parameter
@Contract("_, _, _ -> this") DefaultFunction.Builder<T> parameter(@NotNull @NotNull String name, @NotNull @NotNull Class<?> type, Parameter.Modifier @NotNull ... modifiers) Adds a parameter to this function builder.- Parameters:
name
- The parameter name.type
- The type of the parameter.modifiers
- TheParameter.Modifier
s to apply to this parameter.- Returns:
- This builder.
-
build
Completes this builder with the code to execute on call of this function.- Parameters:
execute
- The code to execute.- Returns:
- The final function.
-