public final class PropertyNode extends Object implements HasChildren
| Constructor and Description |
|---|
PropertyNode(Properties properties,
String key) |
| Modifier and Type | Method and Description |
|---|---|
Value<BigDecimal> |
bigDecimalValue()
Parses the property value as a big decimal.
|
Value<Boolean> |
booleanValue()
Parses the property value as a boolean.
|
PropertyNode |
child(String reference)
Navigates to the given child node.
|
<T> Value<T> |
convertedValue(Function<String,T> valueConversionFunction)
Parses the property value using the given function.
|
Value<Integer> |
intValue()
Parses the property value as an integer.
|
Value<Duration> |
isoDurationValue()
Parses a string such as
PT7H using Duration.parse(CharSequence). |
Value<Period> |
isoPeriodValue()
Parses a string such as
P5Y12M7D using Period.parse(CharSequence). |
Value<Long> |
longValue()
Parses the property value as a long.
|
Value<Path> |
pathValue()
Interprets the property value as an absolute path.
|
Value<Path> |
pathValue(Path basePath)
Interprets the property value as a relative path for the given base path.
|
Value<Duration> |
readableDuration()
Parses a string such as
30 seconds. |
Value<Stream<PropertyNode>> |
referencedNodes()
Parses a comma-separated list of references and returns the respective property nodes.
Absolute and relative references To increase readability of properties files, users can reference child nodes with a shortened syntax: if a reference starts with a ' .', it is resolved starting with the current node (relative reference). |
Value<Stream<String>> |
stringsValue()
Parses a comma-separated list of values.
|
Value<String> |
stringValue()
Gets the property value as a string.
|
String |
toString() |
Value<Instant> |
unixTimestampValue()
Parses a string containing the number of seconds from the epoch of 1970-01-01T00:00:00Z.
|
Value<URL> |
urlValue()
Parses the property value as an absolute URL.
|
Value<URL> |
urlValue(URL context)
Interprets the property value as a relative URL for the given context.
|
Value<Instant> |
utcInstantValue()
Parses a string such as
2020-08-14T12:04:22.00Z using
DateTimeFormatter.ISO_INSTANT. |
Value<ZoneId> |
zoneIdValue()
Parses a string such as
Europe/Berlin using ZoneId.of(String). |
public PropertyNode(Properties properties, String key)
public PropertyNode child(String reference)
child in interface HasChildrenreference - one or more segments of the key to append to the key of the current nodenull.public Value<String> stringValue()
public Value<Boolean> booleanValue()
public Value<Integer> intValue()
public Value<BigDecimal> bigDecimalValue()
public Value<Path> pathValue()
public Value<Path> pathValue(Path basePath)
basePath - the path the property value is relative topublic Value<URL> urlValue()
public Value<URL> urlValue(URL context)
context - the URL the property value is relative topublic Value<Instant> unixTimestampValue()
public Value<Instant> utcInstantValue()
2020-08-14T12:04:22.00Z using
DateTimeFormatter.ISO_INSTANT.public Value<Duration> readableDuration()
30 seconds.public Value<Duration> isoDurationValue()
PT7H using Duration.parse(CharSequence).public Value<Period> isoPeriodValue()
P5Y12M7D using Period.parse(CharSequence).public Value<ZoneId> zoneIdValue()
Europe/Berlin using ZoneId.of(String).public Value<Stream<String>> stringsValue()
public Value<Stream<PropertyNode>> referencedNodes()
.', it is resolved starting with the current node (relative reference). Other
references are resolved starting with the root node (absolute reference).stringsValue().public <T> Value<T> convertedValue(Function<String,T> valueConversionFunction)
Copyright © 2021. All rights reserved.