Class ConfigStrings
java.lang.Object
my.celium.org.config.ConfigStrings
String conversion for
ConfigValues: display, parsing and lookup by
path.
A path is "key" for root values or "category.key" for
categorised ones. Bare-key lookup succeeds when exactly one value carries
that key; otherwise the fully qualified path is required.
All parsing goes through the same validators as programmatic
ConfigValue.set(Object) calls, so /mycel set can never sneak
an out-of-range value past the config screen's rules.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringconstraintHint(ConfigValue<?> value) Short constraint hint: ranges, allowed enum names, max length, ...static StringdefaultToString(ConfigValue<?> value) Human-readable default value.static Stringdescribe(ConfigValue<?> value) One-line type summary used by/mycel get <mod>.static ConfigValue<?> find(MycelConfig config, String path) Finds a value insideconfigby path (see class javadoc).static voidparseAndSet(ConfigValue<?> value, String text) static StringpathOf(ConfigValue<?> value) Canonical path of a value:keyorcategory.key.static StringvalueToString(ConfigValue<?> value) Human-readable current value (lists render comma-separated).
-
Method Details
-
pathOf
Canonical path of a value:keyorcategory.key. -
find
Finds a value insideconfigby path (see class javadoc).- Returns:
- the value, or
nullwhen nothing matches
-
valueToString
Human-readable current value (lists render comma-separated). -
defaultToString
Human-readable default value. -
constraintHint
Short constraint hint: ranges, allowed enum names, max length, ... -
describe
One-line type summary used by/mycel get <mod>. -
parseAndSet
- Throws:
IllegalArgumentException- with a friendly message when invalid
-