Package ch.njol.skript.lang.function
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.
-
Field Summary
Fields inherited from class ch.njol.skript.lang.function.Function
executeWithNulls
-
Constructor Summary
ConstructorsConstructorDescriptionJavaFunction
(Signature<T> sign) 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 TypeMethodDescriptionDeprecated, 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.examples()
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.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
getSince()
Deprecated, for removal: This API element is subject to removal in a future version.keywords()
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.Only used for Skript's documentation.@NotNull String
name()
Deprecated, for removal: This API element is subject to removal in a future version.requires()
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 theFunction
.@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.since()
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.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
-
Constructor Details
-
JavaFunction
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
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, usingFunction.execute(Object[][])
is better; it handles optional and keyed arguments and function event creation automatically.- Specified by:
execute
in classFunction<T>
- Parameters:
event
- Associated function event. This is usually created by Skript.params
- Function parameters. There must beSignature.getMaxParameters()
amount of them, and you need to manually handle default values.- Returns:
- Function return value(s).
-
returnedKeys
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
returnedKeys
in classFunction<T>
- Returns:
- The keys of the values returned by this function, or null if no keys are returned.
-
setReturnedKeys
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
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
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
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
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
Deprecated, for removal: This API element is subject to removal in a future version. -
getExamples
Deprecated, for removal: This API element is subject to removal in a future version. -
getKeywords
Deprecated, for removal: This API element is subject to removal in a future version. -
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 theFunction
. Should be called right after execution.- Specified by:
resetReturnValue
in classFunction<T>
- Returns:
- Whether or not the return value was successfully reset
-
name
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
name
in interfaceDocumentable
- Returns:
- The name.
-
description
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
description
in interfaceDocumentable
- Returns:
- The unmodifiable description.
-
since
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
since
in interfaceDocumentable
- Returns:
- The unmodifiable version history.
-
examples
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
examples
in interfaceDocumentable
- Returns:
- The unmodifiable examples.
-
keywords
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
keywords
in interfaceDocumentable
- Returns:
- The unmodifiable keywords.
-
requires
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
requires
in interfaceDocumentable
- Returns:
- The unmodifiable requirements.
-
DefaultFunction
instead.