public final class ConfigUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends NamedConfig> |
getConfig(ConfigPatternMatcher configPatternMatcher,
Map<String,T> configs,
String name,
Class clazz)
Returns a config for the given name, creating one
if necessary and adding it to the collection of known configurations.
|
static <T> T |
getConfig(ConfigPatternMatcher configPatternMatcher,
Map<String,T> configs,
String name,
Class clazz,
BiConsumer<T,String> nameSetter)
Similar to
getConfig(ConfigPatternMatcher, Map, String, Class)
This method is introduced specifically for solving problem of EventJournalConfig
use getConfig(ConfigPatternMatcher, Map, String, Class) along with NamedConfig
where possible |
static <T> T |
lookupByPattern(ConfigPatternMatcher configPatternMatcher,
Map<String,T> configPatterns,
String itemName) |
public static <T> T lookupByPattern(ConfigPatternMatcher configPatternMatcher, Map<String,T> configPatterns, String itemName)
public static <T extends NamedConfig> T getConfig(ConfigPatternMatcher configPatternMatcher, Map<String,T> configs, String name, Class clazz)
The configuration is found by matching the configuration name
pattern to the provided name
without the partition qualifier
(the part of the name after '@'
).
If no configuration matches, it will create one by cloning the
"default"
configuration and add it to the configuration
collection.
This method is intended to easily and fluently create and add configurations more specific than the default configuration without explicitly adding it by invoking addXConfig(..)
Because it adds new configurations if they are not already present, this method is intended to be used before this config is used to create a hazelcast instance. Afterwards, newly added configurations may be ignored.
name
- name of the configConfigurationException
- if ambiguous configurations are foundStringPartitioningStrategy.getBaseName(java.lang.String)
,
Config.setConfigPatternMatcher(ConfigPatternMatcher)
,
Config##getConfigPatternMatcher()
public static <T> T getConfig(ConfigPatternMatcher configPatternMatcher, Map<String,T> configs, String name, Class clazz, BiConsumer<T,String> nameSetter)
getConfig(ConfigPatternMatcher, Map, String, Class)
This method is introduced specifically for solving problem of EventJournalConfig
use getConfig(ConfigPatternMatcher, Map, String, Class)
along with NamedConfig
where possibleCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.