public static final class OverrideSource.OverrideData
extends java.lang.Object
OverrideData supports the *
wildcard character which represents one or more regex word characters:
[a-zA-Z_0-9]. In particular the from(java.io.Reader) and
fromWildcards(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.
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.util.Map.Entry<java.util.function.Predicate<Config.Key>,java.lang.String>> |
data()
Returns the predicate/replacement value pairs.
|
static OverrideSource.OverrideData |
empty()
Creates an
OverrideData object containing no overrides. |
static OverrideSource.OverrideData |
from(java.util.List<java.util.Map.Entry<java.util.function.Predicate<Config.Key>,java.lang.String>> data)
Creates
OverrideData from a List of
predicate/replacement pairs. |
static OverrideSource.OverrideData |
from(java.io.Reader reader)
Creates
OverrideData from a Reader. |
static OverrideSource.OverrideData |
fromWildcards(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> wildcards)
Creates
OverrideData from a List of String
pairs. |
public static OverrideSource.OverrideData from(java.util.List<java.util.Map.Entry<java.util.function.Predicate<Config.Key>,java.lang.String>> data)
OverrideData from a List of
predicate/replacement pairs. This method does not use
wildcarding.data - the predicate/replacement pairsOverrideData containing the specified pairspublic static OverrideSource.OverrideData fromWildcards(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> wildcards)
OverrideData from a List of String
pairs.
wildcards - List of pairs of
wildcard expressions and corresponding
replacement valuesOverrideData object containing the
Predicate/String pairs corresponding to the
wildcard/replacement pairspublic static OverrideSource.OverrideData from(java.io.Reader reader) throws java.io.IOException
OverrideData from a Reader.
The Reader should provide lines in Java
Properties file format. In each line the
String to the left of the = sign is either a
Config.Key or a
wildcard expressions as described
above. The String to the right of the = sign is the
replacement value.reader - a sourcejava.io.IOException - when an error occurred when reading from the
readerpublic static OverrideSource.OverrideData empty()
OverrideData object containing no overrides.public java.util.List<java.util.Map.Entry<java.util.function.Predicate<Config.Key>,java.lang.String>> data()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.