public interface Config
builder().
Example usage:
Config config = Config.builder()
.addFile("/etc/app/normal.conf")
.build();
Value thumbs = config.get("thumbs", Thumbnails.class);
Value mediumSize = config.get("thumbs.medium", Size.class);
The format is similar to JSON but is not as strict. For example it does not require quotes around keys or string values and the initial braces can be skipped.
Example:
thumbs: {
medium: { width: 400, height: 400 }
small: {
width: 100
height: 100
}
}
# Override the width
thumbs.small.width: 150
| Modifier and Type | Method and Description |
|---|---|
<T> T |
asObject(String path,
Class<T> type)
Resolve values as the given path as an object.
|
static ConfigBuilder |
builder()
Get a new
ConfigBuilder to create a new configuration. |
<T> Value<T> |
get(String path,
Class<T> type)
Resolve configuration values as an object.
|
Collection<String> |
keys(String path)
Get the direct subkeys of the given path.
|
static ConfigBuilder builder()
ConfigBuilder to create a new configuration.<T> T asObject(String path, Class<T> type)
get(String, Class) and then Value#getOrDefault()
with the value null.path - type - <T> Value<T> get(String path, Class<T> type)
path - type - Collection<String> keys(String path)
path - Copyright © 2016. All rights reserved.