Class FunctionReference<T>

java.lang.Object
ch.njol.skript.lang.function.FunctionReference<T>
All Implemented Interfaces:
Contract, Executable<org.bukkit.event.Event,T[]>

@Deprecated(forRemoval=true, since="2.14") public class FunctionReference<T> extends Object implements Contract, Executable<org.bukkit.event.Event,T[]>
Deprecated, for removal: This API element is subject to removal in a future version.
Use FunctionReference instead.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final @Nullable String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Script in which this reference is found.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FunctionReference(String functionName, @Nullable Node node, @Nullable String script, @Nullable Class<? extends T>[] returnTypes, Expression<?>[] params)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected T @Nullable []
    execute(org.bukkit.event.Event event)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    T[]
    execute(org.bukkit.event.Event event, Object... arguments)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    The contract is used in preference to the function for determining return type, etc.
    @Nullable Function<? extends T>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable Class<? extends T>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable Class<?>
    getReturnType(Expression<?>... arguments)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    isSingle(Expression<?>... arguments)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    String @Nullable []
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    toString(@Nullable org.bukkit.event.Event event, boolean debug)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    validateFunction(boolean first)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Validates this function reference.
    boolean
    validateParameterArity(boolean first)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • script

      @Nullable public final @Nullable String script
      Deprecated, for removal: This API element is subject to removal in a future version.
      Script in which this reference is found. Used for function unload safety checks.
  • Constructor Details

    • FunctionReference

      public FunctionReference(String functionName, @Nullable @Nullable Node node, @Nullable @Nullable String script, @Nullable @Nullable Class<? extends T>[] returnTypes, Expression<?>[] params)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • validateParameterArity

      public boolean validateParameterArity(boolean first)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • validateFunction

      public boolean validateFunction(boolean first)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Validates this function reference. Prints errors if needed.
      Parameters:
      first - True if this is called while loading a script. False when this is called when the function signature changes.
      Returns:
      True if validation succeeded.
    • getFunction

      @Nullable public @Nullable Function<? extends T> getFunction()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • returnedKeys

      public String @Nullable [] returnedKeys()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • resetReturnValue

      public boolean resetReturnValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • execute

      protected T @Nullable [] execute(org.bukkit.event.Event event)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isSingle

      public boolean isSingle()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isSingle

      public boolean isSingle(Expression<?>... arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isSingle in interface Contract
      Returns:
      Whether, given these parameters, this will return a single value
      See Also:
    • getReturnType

      @Nullable public @Nullable Class<? extends T> getReturnType()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getReturnType

      @Nullable public @Nullable Class<?> getReturnType(Expression<?>... arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getReturnType in interface Contract
      Returns:
      What this will return, given these parameters
      See Also:
    • getContract

      public Contract getContract()
      Deprecated, for removal: This API element is subject to removal in a future version.
      The contract is used in preference to the function for determining return type, etc.
      Returns:
      The contract determining this function's parse-time hints, potentially this reference
    • toString

      public String toString(@Nullable @Nullable org.bukkit.event.Event event, boolean debug)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • execute

      public T[] execute(org.bukkit.event.Event event, Object... arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      execute in interface Executable<org.bukkit.event.Event,T[]>