Package ch.njol.skript.lang.function
Class Parameter<T>
java.lang.Object
ch.njol.skript.lang.function.Parameter<T>
- All Implemented Interfaces:
Parameter<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.skriptlang.skript.common.function.Parameter
Parameter.Modifier
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Parameter
(String name, ClassInfo<T> type, boolean single, @Nullable Expression<? extends T> def, boolean keyed) Deprecated, for removal: This API element is subject to removal in a future version.Parameter
(String name, ClassInfo<T> type, boolean single, @Nullable Expression<? extends T> def, boolean keyed, boolean optional) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable Expression
<? extends T> Get the Expression that will be used to provide the default value of this parameter when the function is called.getName()
Deprecated, for removal: This API element is subject to removal in a future version.Usename()
instead.getType()
boolean
Returns whether this parameter is optional or not.boolean
Get whether this parameter takes one or many values.@Unmodifiable @NotNull Set
<Parameter.Modifier> @NotNull String
name()
static <T> @Nullable Parameter
<T> newInstance
(String name, ClassInfo<T> type, boolean single, @Nullable String def) Parses function parameters from a string.toString()
toString
(boolean debug) type()
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.skriptlang.skript.common.function.Parameter
hasModifier, single
-
Field Details
-
PARAM_PATTERN
-
-
Constructor Details
-
Parameter
@Deprecated(since="2.13", forRemoval=true) public Parameter(String name, ClassInfo<T> type, boolean single, @Nullable @Nullable Expression<? extends T> def) Deprecated, for removal: This API element is subject to removal in a future version. -
Parameter
@Deprecated(since="2.13", forRemoval=true) public Parameter(String name, ClassInfo<T> type, boolean single, @Nullable @Nullable Expression<? extends T> def, boolean keyed) Deprecated, for removal: This API element is subject to removal in a future version. -
Parameter
@Deprecated(since="2.13", forRemoval=true) public Parameter(String name, ClassInfo<T> type, boolean single, @Nullable @Nullable Expression<? extends T> def, boolean keyed, boolean optional) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
isOptional
public boolean isOptional()Returns whether this parameter is optional or not.- Returns:
- Whether this parameter is optional or not.
-
getType
- Returns:
- The type of this parameter as a
ClassInfo
.
-
newInstance
-
parse
Parses function parameters from a string. The string should look something like this:"something: string, something else: number = 12"
- Parameters:
args
- The string to parse.- Returns:
- The parsed parameters
-
getName
Deprecated, for removal: This API element is subject to removal in a future version.Usename()
instead. -
getDefaultExpression
Get the Expression that will be used to provide the default value of this parameter when the function is called.- Returns:
- Expression that will provide default value of this parameter
-
isSingleValue
public boolean isSingleValue()Get whether this parameter takes one or many values.- Returns:
- True if this parameter takes one value, false otherwise
-
equals
-
toString
-
toString
-
name
-
type
-
modifiers
-
DefaultFunction.Builder.parameter(String, Class, Modifier...)
instead.