{ "a" : 42 }
syntax. {@code ConfigObject} implements {@code java.util.Map
Like all {@link ConfigValue} subtypes, {@code ConfigObject} is immutable.This makes it threadsafe and you never have to create "defensive copies." The mutator methods from {@link java.util.Map} all throw{@link java.lang.UnsupportedOperationException}.
The {@link ConfigValue#valueType} method on an object returns{@link ConfigValueType#OBJECT}.
In most cases you want to use the {@link Config} interface rather than thisone. Call {@link #toConfig()} to convert a {@code ConfigObject} to a{@code Config}.
The API for a {@code ConfigObject} is in terms of keys, while the API for a{@link Config} is in terms of path expressions. Conceptually,{@code ConfigObject} is a tree of maps from keys to values, while a{@code Config} is a one-level map from paths to values.
Use {@link ConfigUtil#joinPath} and {@link ConfigUtil#splitPath} to convertbetween path expressions and individual path elements (keys).
A {@code ConfigObject} may contain null values, which will have{@link ConfigValue#valueType()} equal to {@link ConfigValueType#NULL}. If {@code get()} returns Java's null then the key was not present in the parsedfile (or wherever this value tree came from). If {@code get()} returns a{@link ConfigValue} with type {@code ConfigValueType#NULL} then the key wasset to null explicitly in the config file.
Do not implement {@code ConfigObject}; it should only be implemented by the config library. Arbitrary implementations will not work because the library internals assume a specific concrete implementation. Also, this interface is likely to grow new methods over time, so third-party implementations will break.
|
|
|
|
|
|
|
|
|
|
|
|