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
Strings; 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.OverrideDataCreatesOverrideDatafrom aReader.static OverrideSource.OverrideDataCreatesOverrideDatafrom aListof predicate/replacement pairs.static OverrideSource.OverrideDatacreateFromWildcards(List<Map.Entry<String, String>> wildcards) CreatesOverrideDatafrom aListofStringpairs.data()Returns the predicate/replacement value pairs.static OverrideSource.OverrideDataempty()Creates anOverrideDataobject containing no overrides.
-
Method Details
-
create
public static OverrideSource.OverrideData create(List<Map.Entry<Predicate<Config.Key>, String>> data) CreatesOverrideDatafrom aListof predicate/replacement pairs. This method does not use wildcarding.- Parameters:
data- the predicate/replacement pairs- Returns:
OverrideDatacontaining the specified pairs
-
createFromWildcards
public static OverrideSource.OverrideData createFromWildcards(List<Map.Entry<String, String>> wildcards) CreatesOverrideDatafrom aListofStringpairs.- Parameters:
wildcards-Listof pairs of wildcard expressions and corresponding replacement values- Returns:
OverrideDataobject containing thePredicate/Stringpairs corresponding to the wildcard/replacement pairs
-
create
CreatesOverrideDatafrom aReader. TheReadershould provide lines in JavaPropertiesfile format. In each line theStringto the left of the=sign is either aConfig.Keyor a wildcard expressions as described above. TheStringto 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 anOverrideDataobject containing no overrides.- Returns:
- an empty object
-
data
Returns the predicate/replacement value pairs.- Returns:
- a list of pairs of predicate and replacement value
-