public interface PropsRef
java.util.Properties
class as a map.Modifier and Type | Method and Description |
---|---|
static PropsRef |
aggregate(Collection<PropsRef> refs) |
static PropsRef |
aggregate(PropsRef... refs) |
default Optional<Boolean> |
boolOpt(String key)
Returns a bool opt value of specified key.
|
static PropsRef |
copyOf(Map<String,String> props) |
static PropsRef |
copyOf(Properties props) |
default String |
format(String key,
Object... args)
Returns the formatted string with
MessageFormat . |
default Optional<String> |
formatOpt(String key,
Object... args)
Returns the
Optional value of formatted string with MessageFormat . |
default String |
getProperty(String key)
Returns the string of specified key.
|
default String |
getProperty(String key,
String defaultValue)
Returns the string of specified key.
|
default int |
i(String key)
This is an alias of
integer(String) . |
default int |
integer(String key)
Returns the int value of specified key.
|
default int |
integer(String key,
int defaultValue)
Returns the int value of specified key.
|
default OptionalInt |
integerOpt(String key)
Returns the optional int value of specified key.
|
default boolean |
isTrue(String key)
Returns boolean value of specified key.
|
default String |
s(String key)
This is an alias of
string(String) . |
default String |
string(String key)
Returns the string of specified key.
|
default String |
string(String key,
String defaultValue)
Returns the string of specified key.
|
Optional<String> |
stringOpt(String key)
Returns the Optional string of specified key.
|
static PropsRef |
wrap(Map<String,String> props) |
static PropsRef |
wrap(Properties props) |
Optional<String> stringOpt(String key)
key
- key for the valuedefault String getProperty(String key)
key
- key for the valuedefault String getProperty(String key, String defaultValue)
key
- key for the valuedefaultValue
- default string value if it contains keydefault String string(String key)
key
- key for the valuedefault String string(String key, String defaultValue)
key
- key for the valuedefaultValue
- the value to be returned if there is no value of the specified keydefault String s(String key)
string(String)
.key
- key for the valuedefault Optional<String> formatOpt(String key, Object... args)
Optional
value of formatted string with MessageFormat
.key
- key for the format stringargs
- arguments to apply to the format stringdefault String format(String key, Object... args)
MessageFormat
.key
- key for the format stringargs
- arguments to apply to the format stringdefault OptionalInt integerOpt(String key)
key
- key for the valuedefault int integer(String key)
key
- key for the valuedefault int integer(String key, int defaultValue)
key
- key for the valuedefaultValue
- the value to be returned if there is no value of the specified keydefault int i(String key)
integer(String)
.key
- key for the valuedefault Optional<Boolean> boolOpt(String key)
key
- key for the valuedefault boolean isTrue(String key)
key
- key for the valuestatic PropsRef wrap(Properties props)
static PropsRef copyOf(Properties props)
static PropsRef aggregate(Collection<PropsRef> refs)
Copyright © 2019. All rights reserved.