Class StringType
java.lang.Object
net.ixdarklord.coolcatcore.api.config.type.StringType
- All Implemented Interfaces:
ConfigType<String>
Text, optionally limited in length, required not to be empty, or matched against a pattern.
-
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<String>codec()List<net.minecraft.network.chat.Component>describe()The constraints in words, for the file's comments and the screen's tooltips ("Range: 0 ~ 10").The value as a player would type it, the inverse ofConfigType.parse(java.lang.String).booleanintReads a value typed by a player, and validates it.@Nullable Patternpattern()Checks a value, possibly correcting it.withMaxLength(int maxLength) withNotEmpty(boolean notEmpty) withPattern(@Nullable String regex) The whole text must match the pattern.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ixdarklord.coolcatcore.api.config.type.ConfigType
equals, suggestions
-
Method Details
-
maxLength
public int maxLength() -
isNotEmpty
public boolean isNotEmpty() -
pattern
-
withMaxLength
-
withNotEmpty
-
withPattern
The whole text must match the pattern. -
codec
- Specified by:
codecin interfaceConfigType<String>
-
validate
Description copied from interface:ConfigTypeChecks a value, possibly correcting it.- Specified by:
validatein interfaceConfigType<String>
-
parse
Description copied from interface:ConfigTypeReads a value typed by a player, and validates it. By default the text is JSON for the codec.- Specified by:
parsein interfaceConfigType<String>
-
format
Description copied from interface:ConfigTypeThe value as a player would type it, the inverse ofConfigType.parse(java.lang.String). By default compact JSON.- Specified by:
formatin interfaceConfigType<String>
-
describe
Description copied from interface:ConfigTypeThe constraints in words, for the file's comments and the screen's tooltips ("Range: 0 ~ 10").- Specified by:
describein interfaceConfigType<String>
-