java.lang.Object
io.helidon.config.spi.OverrideSource.OverrideData
- Enclosing interface:
OverrideSource
Group of config override settings.
OverrideData
supports the *
wildcard character which represents one or more regex word characters:
[a-zA-Z_0-9]. In particular the create(java.io.Reader)
and
createFromWildcards(java.util.List<java.util.Map.Entry<java.lang.String, java.lang.String>>)
static factory methods deal with pairs of
String
s; the first is a possible wildcard expression, and the
second is the replacement value the config system will use as it loads
any Config
value node with a key that matches the wildcard
expression.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OverrideSource.OverrideData
CreatesOverrideData
from aReader
.static OverrideSource.OverrideData
CreatesOverrideData
from aList
of predicate/replacement pairs.static OverrideSource.OverrideData
createFromWildcards
(List<Map.Entry<String, String>> wildcards) CreatesOverrideData
from aList
ofString
pairs.data()
Returns the predicate/replacement value pairs.static OverrideSource.OverrideData
empty()
Creates anOverrideData
object containing no overrides.
-
Method Details
-
create
public static OverrideSource.OverrideData create(List<Map.Entry<Predicate<Config.Key>, String>> data) CreatesOverrideData
from aList
of predicate/replacement pairs. This method does not use wildcarding.- Parameters:
data
- the predicate/replacement pairs- Returns:
OverrideData
containing the specified pairs
-
createFromWildcards
public static OverrideSource.OverrideData createFromWildcards(List<Map.Entry<String, String>> wildcards) CreatesOverrideData
from aList
ofString
pairs.- Parameters:
wildcards
-List
of pairs of wildcard expressions and corresponding replacement values- Returns:
OverrideData
object containing thePredicate
/String
pairs corresponding to the wildcard/replacement pairs
-
create
CreatesOverrideData
from aReader
. TheReader
should provide lines in JavaProperties
file format. In each line theString
to the left of the=
sign is either aConfig.Key
or a wildcard expressions as described above. TheString
to the right of the=
sign is the replacement value.- Parameters:
reader
- a source- Returns:
- a new instance
- Throws:
ConfigException
- when an error occurred when reading from the reader
-
empty
Creates anOverrideData
object containing no overrides.- Returns:
- an empty object
-
data
Returns the predicate/replacement value pairs.- Returns:
- a list of pairs of predicate and replacement value
-