Package io.helidon.config.spi
Class OverrideSource.OverrideData
- java.lang.Object
-
- io.helidon.config.spi.OverrideSource.OverrideData
-
- Enclosing interface:
- OverrideSource
public static final class OverrideSource.OverrideData extends Object
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 thecreate(java.io.Reader)
andcreateFromWildcards(java.util.List<java.util.Map.Entry<java.lang.String, java.lang.String>>)
static factory methods deal with pairs ofString
s; the first is a possible wildcard expression, and the second is the replacement value the config system will use as it loads anyConfig
value node with a key that matches the wildcard expression.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OverrideSource.OverrideData
create(Reader reader)
CreatesOverrideData
from aReader
.static OverrideSource.OverrideData
create(List<Map.Entry<Predicate<Config.Key>,String>> data)
CreatesOverrideData
from aList
of predicate/replacement pairs.static OverrideSource.OverrideData
createFromWildcards(List<Map.Entry<String,String>> wildcards)
CreatesOverrideData
from aList
ofString
pairs.List<Map.Entry<Predicate<Config.Key>,String>>
data()
Returns the predicate/replacement value pairs.static OverrideSource.OverrideData
empty()
Creates anOverrideData
object containing no overrides.
-
-
-
Method Detail
-
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
public static OverrideSource.OverrideData create(Reader reader) throws IOException
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:
IOException
- when an error occurred when reading from the reader
-
empty
public static OverrideSource.OverrideData empty()
Creates anOverrideData
object containing no overrides.- Returns:
- an empty object
-
data
public List<Map.Entry<Predicate<Config.Key>,String>> data()
Returns the predicate/replacement value pairs.- Returns:
- a list of pairs of predicate and replacement value
-
-