Class FunctionReference<T>
java.lang.Object
org.skriptlang.skript.common.function.FunctionReference<T>
- Type Parameters:
T- The return type of this reference.
- All Implemented Interfaces:
Debuggable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn argument.static enumThe type of argument. -
Constructor Summary
ConstructorsConstructorDescriptionFunctionReference(@Nullable String namespace, @NotNull String name, @NotNull Signature<T> signature, @NotNull FunctionReference.Argument<Expression<?>>[] arguments) -
Method Summary
Modifier and TypeMethodDescription@NotNull FunctionReference.Argument<Expression<?>>[]execute(org.bukkit.event.Event event) Executes the function referred to by this reference.function()booleanisSingle()@NotNull Stringname()toString(@Nullable org.bukkit.event.Event event, boolean debug) booleanvalidate()Validates this function reference.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.njol.skript.lang.Debuggable
toString
-
Constructor Details
-
FunctionReference
public FunctionReference(@Nullable @Nullable String namespace, @NotNull @NotNull String name, @NotNull @NotNull Signature<T> signature, @NotNull @NotNull FunctionReference.Argument<Expression<?>>[] arguments)
-
-
Method Details
-
validate
public boolean validate()Validates this function reference.- Returns:
- True if this is a valid function reference, false if not.
-
execute
Executes the function referred to by this reference.- Parameters:
event- The event to use for execution.- Returns:
- The return value of the function.
-
function
- Returns:
- The function referred to by this reference.
-
signature
- Returns:
- The signature belonging to this reference.
-
namespace
- Returns:
- The namespace that this reference is in.
-
name
- Returns:
- The name of the function being referenced.
-
arguments
- Returns:
- The passed arguments.
-
isSingle
public boolean isSingle()- Returns:
- Whether this reference returns a single or multiple values.
-
toString
- Specified by:
toStringin interfaceDebuggable- Parameters:
event- The event to get information from. This is always null if debug == false.debug- If true this should print more information, if false this should print what is shown to the end user- Returns:
- String representation of this object
-