public interface Config extends Function<String,String>, Supplier<Config>
| Modifier and Type | Method and Description |
|---|---|
default String |
apply(String key)
Same as
getString(String). |
static ConfigFrom |
from()
Convenience method for fluent syntax.
|
default Config |
get() |
BigDecimal |
getBigDecimal(String key) |
BigDecimal |
getBigDecimal(String key,
BigDecimal defaultValue) |
BigDecimal |
getBigDecimalOrThrow(String key) |
boolean |
getBooleanOrFalse(String key)
Read a boolean value from the configuration.
|
boolean |
getBooleanOrThrow(String key) |
boolean |
getBooleanOrTrue(String key)
Read a boolean value from the configuration.
|
Double |
getDouble(String key) |
double |
getDouble(String key,
double defaultValue) |
double |
getDoubleOrThrow(String key) |
Float |
getFloat(String key) |
float |
getFloat(String key,
float defaultValue) |
float |
getFloatOrThrow(String key) |
Integer |
getInteger(String key) |
int |
getInteger(String key,
int defaultValue) |
int |
getIntegerOrThrow(String key) |
Long |
getLong(String key) |
long |
getLong(String key,
long defaultValue) |
long |
getLongOrThrow(String key) |
String |
getString(String key) |
String |
getString(String key,
String defaultValue) |
String |
getStringOrThrow(String key) |
String |
sources()
Show where configuration is coming from.
|
@Nonnull static ConfigFrom from()
@Nullable String getString(@Nonnull String key)
@Nonnull String getStringOrThrow(@Nonnull String key)
ConfigMissingException - if no value could be read for the specified keydefault String apply(String key)
getString(String). Useful for passing configs around
without static dependencies.int getIntegerOrThrow(@Nonnull String key)
ConfigMissingException - if no value could be read for the specified keylong getLongOrThrow(@Nonnull String key)
ConfigMissingException - if no value could be read for the specified keyfloat getFloatOrThrow(@Nonnull String key)
ConfigMissingException - if no value could be read for the specified keydouble getDoubleOrThrow(@Nonnull String key)
ConfigMissingException - if no value could be read for the specified key@Nullable BigDecimal getBigDecimal(@Nonnull String key)
@Nonnull BigDecimal getBigDecimal(String key, @Nonnull BigDecimal defaultValue)
@Nonnull BigDecimal getBigDecimalOrThrow(String key)
ConfigMissingException - if no value could be read for the specified keyboolean getBooleanOrFalse(@Nonnull String key)
boolean getBooleanOrTrue(@Nonnull String key)
boolean getBooleanOrThrow(@Nonnull String key)
ConfigMissingException - if no value could be read for the specified keyString sources()
Copyright © 2020. All rights reserved.