Package ch.njol.skript.lang.function
Class Signature<T>
java.lang.Object
ch.njol.skript.lang.function.Signature<T>
- All Implemented Interfaces:
Signature<T>
Function signature: name, parameter types and a return type.
-
Constructor Summary
ConstructorsConstructorDescriptionSignature(@Nullable String script, String name, Parameter<?>[] parameters, boolean local, @Nullable ClassInfo<T> returnType, boolean single, @Nullable Contract contract) Signature(@Nullable String script, String name, Parameter<?>[] parameters, boolean local, @Nullable ClassInfo<T> returnType, boolean single, String stacktrace) Signature(@Nullable String script, String name, Parameters parameters, Class<T> returnType, boolean local) Signature(@Nullable String script, String name, Parameters parameters, Class<T> returnType, boolean local, @Nullable Contract contract) Signature(String script, String name, Parameter<?>[] parameters, boolean local, ClassInfo<T> returnType, boolean single, String stacktrace, @Nullable Contract contract) Signature(String namespace, String name, Parameter<?>[] parameters, Class<T> returnType, boolean single, @Nullable Contract contract) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCall(FunctionReference<?> reference) Adds a reference to the clearing list.calls()contract()@Nullable ContractintGets maximum number of parameters that the function described by this signature is able to take.intGets minimum number of parameters that the function described by this signature is able to take.getName()Deprecated, for removal: This API element is subject to removal in a future version.Unused.Parameter<?> getParameter(int index) Deprecated, for removal: This API element is subject to removal in a future version.UsegetParameter(String)orparameters()instead.Parameter<?> getParameter(@NotNull String name) Parameter<?>[]Deprecated, for removal: This API element is subject to removal in a future version.Useparameters()instead.inthashCode()booleanisLocal()booleanisSingle()@NotNull ParameterstoString()toString(boolean includeReturnType, boolean debug)
-
Constructor Details
-
Signature
-
Signature
-
Signature
-
Signature
-
Signature
public Signature(@Nullable @Nullable String script, String name, Parameters parameters, Class<T> returnType, boolean local) -
Signature
-
-
Method Details
-
getParameter
Deprecated, for removal: This API element is subject to removal in a future version.UsegetParameter(String)orparameters()instead. -
getParameters
Deprecated, for removal: This API element is subject to removal in a future version.Useparameters()instead. -
returnType
- Specified by:
returnTypein interfaceSignature<T>- Returns:
- The type of this parameter.
-
parameters
- Specified by:
parametersin interfaceSignature<T>- Returns:
- A
SequencedMapcontaining all parameters.
-
contract
-
addCall
Description copied from interface:SignatureAdds a reference to the clearing list. -
getParameter
- Parameters:
name- The parameter name.- Returns:
- The parameter with the specified name, or null if none is found.
-
getName
-
isLocal
public boolean isLocal() -
namespace
- Returns:
- The namespace of this signature.
-
getReturnType
-
isSingle
public boolean isSingle() -
getOriginClassPath
Deprecated, for removal: This API element is subject to removal in a future version.Unused. -
getContract
-
calls
-
getMaxParameters
public int getMaxParameters()Gets maximum number of parameters that the function described by this signature is able to take.- Returns:
- Maximum number of parameters.
-
getMinParameters
public int getMinParameters()Gets minimum number of parameters that the function described by this signature is able to take. Parameters that have default values and do not have any parameters that are mandatory after them, are optional.- Returns:
- Minimum number of parameters required.
-
hashCode
public int hashCode() -
toString
-
toString
-