Class JavaFunction<T>

java.lang.Object
ch.njol.skript.lang.function.Function<T>
ch.njol.skript.lang.function.JavaFunction<T>
All Implemented Interfaces:
Documentable, Function<T>
Direct Known Subclasses:
SimpleJavaFunction

@Deprecated(since="2.13", forRemoval=true) public abstract class JavaFunction<T> extends Function<T> implements Documentable
Deprecated, for removal: This API element is subject to removal in a future version.
Use DefaultFunction instead.
  • Field Summary

    Fields inherited from class ch.njol.skript.lang.function.Function

    executeWithNulls
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    JavaFunction(String name, Parameter<?>[] parameters, ClassInfo<T> returnType, boolean single)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    JavaFunction(String name, Parameter<?>[] parameters, ClassInfo<T> returnType, boolean single, @Nullable Contract contract)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Unmodifiable @NotNull List<String>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    description(String... description)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Only used for Skript's documentation.
    @Unmodifiable @NotNull List<String>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    examples(String... examples)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Only used for Skript's documentation.
    abstract T @Nullable []
    execute(FunctionEvent<?> event, Object[][] params)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Executes this function with given parameters.
    String @Nullable []
    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.
     
    String @Nullable []
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Unmodifiable @NotNull List<String>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    keywords(String... keywords)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Only used for Skript's documentation.
    @NotNull String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Unmodifiable @NotNull List<String>
    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.
    Resets the return value of the Function.
    @NotNull String @Nullable []
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setReturnedKeys(@NotNull String @Nullable [] keys)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the keys that will be returned by this function.
    @Unmodifiable @NotNull List<String>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    since(String since)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Only used for Skript's documentation.

    Methods inherited from class ch.njol.skript.lang.function.Function

    execute, getName, getParameter, getParameters, getReturnType, getSignature, isSingle, signature, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JavaFunction

      public JavaFunction(Signature<T> sign)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • JavaFunction

      public JavaFunction(String name, Parameter<?>[] parameters, ClassInfo<T> returnType, boolean single)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • JavaFunction

      public JavaFunction(String name, Parameter<?>[] parameters, ClassInfo<T> returnType, boolean single, @Nullable @Nullable Contract contract)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • execute

      public abstract T @Nullable [] execute(FunctionEvent<?> event, Object[][] params)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Function
      Executes this function with given parameters. Usually, using Function.execute(Object[][]) is better; it handles optional and keyed arguments and function event creation automatically.
      Specified by:
      execute in class Function<T>
      Parameters:
      event - Associated function event. This is usually created by Skript.
      params - Function parameters. There must be Signature.getMaxParameters() amount of them, and you need to manually handle default values.
      Returns:
      Function return value(s).
    • returnedKeys

      @NotNull public @NotNull String @Nullable [] returnedKeys()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      returnedKeys in class Function<T>
      Returns:
      The keys of the values returned by this function, or null if no keys are returned.
    • setReturnedKeys

      public void setReturnedKeys(@NotNull @NotNull String @Nullable [] keys)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the keys that will be returned by this function.
      Note: The length of the keys array must match the number of return values.
      Parameters:
      keys - An array of keys to be returned by the function. Can be null.
      Throws:
      IllegalStateException - If the function is returns a single value.
    • description

      public JavaFunction<T> description(String... description)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • examples

      public JavaFunction<T> examples(String... examples)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • keywords

      public JavaFunction<T> keywords(String... keywords)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Only used for Skript's documentation.
      Parameters:
      keywords -
      Returns:
      This JavaFunction object
    • since

      public JavaFunction<T> since(String since)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • getDescription

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

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

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

      @Nullable public @Nullable String getSince()
      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.
      Description copied from class: Function
      Resets the return value of the Function. Should be called right after execution.
      Specified by:
      resetReturnValue in class Function<T>
      Returns:
      Whether or not the return value was successfully reset
    • name

      @NotNull public @NotNull String name()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      name in interface Documentable
      Returns:
      The name.
    • description

      @NotNull public @Unmodifiable @NotNull List<String> description()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      description in interface Documentable
      Returns:
      The unmodifiable description.
    • since

      @NotNull public @Unmodifiable @NotNull List<String> since()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      since in interface Documentable
      Returns:
      The unmodifiable version history.
    • examples

      @NotNull public @Unmodifiable @NotNull List<String> examples()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      examples in interface Documentable
      Returns:
      The unmodifiable examples.
    • keywords

      @NotNull public @Unmodifiable @NotNull List<String> keywords()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      keywords in interface Documentable
      Returns:
      The unmodifiable keywords.
    • requires

      @NotNull public @Unmodifiable @NotNull List<String> requires()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      requires in interface Documentable
      Returns:
      The unmodifiable requirements.