Class VariableStringEntryData
java.lang.Object
org.skriptlang.skript.lang.entry.EntryData<VariableString>
org.skriptlang.skript.lang.entry.KeyValueEntryData<VariableString>
org.skriptlang.skript.lang.entry.util.VariableStringEntryData
A type of
KeyValueEntryData
designed to parse its value as a VariableString
.
The StringMode
may be specified during construction.
Constructors without a StringMode parameter assume StringMode.MESSAGE
.
This data CAN return null if string parsing fails (e.g. the user formatted their string wrong).-
Constructor Summary
ConstructorDescriptionVariableStringEntryData
(String key, @Nullable VariableString defaultValue, boolean optional) UsesStringMode.MESSAGE
as the default string mode.VariableStringEntryData
(String key, @Nullable VariableString defaultValue, boolean optional, StringMode stringMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable VariableString
Parses a String value using this entry data.Methods inherited from class org.skriptlang.skript.lang.entry.KeyValueEntryData
canCreateWith, getSeparator, getValue
Methods inherited from class org.skriptlang.skript.lang.entry.EntryData
getDefaultValue, getKey, isOptional
-
Constructor Details
-
VariableStringEntryData
public VariableStringEntryData(String key, @Nullable @Nullable VariableString defaultValue, boolean optional) UsesStringMode.MESSAGE
as the default string mode.- See Also:
-
VariableStringEntryData
public VariableStringEntryData(String key, @Nullable @Nullable VariableString defaultValue, boolean optional, StringMode stringMode) - Parameters:
stringMode
- Sets how to parse the string (e.g. as a variable, message, etc.).
-
-
Method Details
-
getValue
Description copied from class:KeyValueEntryData
Parses a String value using this entry data.- Specified by:
getValue
in classKeyValueEntryData<VariableString>
- Parameters:
value
- The String value to parse.- Returns:
- The parsed value.
-