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

public final class FunctionReference<T> extends Object implements Debuggable
A reference to a Function<T> found in a script.
  • Constructor Details

  • Method Details

    • validate

      public boolean validate()
      Validates this function reference.
      Returns:
      True if this is a valid function reference, false if not.
    • execute

      public T execute(org.bukkit.event.Event event)
      Executes the function referred to by this reference.
      Parameters:
      event - The event to use for execution.
      Returns:
      The return value of the function.
    • function

      public Function<T> function()
      Returns:
      The function referred to by this reference.
    • signature

      public Signature<T> signature()
      Returns:
      The signature belonging to this reference.
    • namespace

      public String namespace()
      Returns:
      The namespace that this reference is in.
    • name

      @NotNull public @NotNull String name()
      Returns:
      The name of the function being referenced.
    • arguments

      @NotNull public @NotNull FunctionReference.Argument<Expression<?>>[] arguments()
      Returns:
      The passed arguments.
    • isSingle

      public boolean isSingle()
      Returns:
      Whether this reference returns a single or multiple values.
    • toString

      public String toString(@Nullable @Nullable org.bukkit.event.Event event, boolean debug)
      Specified by:
      toString in interface Debuggable
      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