/** * Get a config value with a default. If no value is given, as a last resort, project properties are looked up. * * @param key key part to lookup. The whole key is build up from <code>prefix + "." + key</code>. If key is null, * then only the prefix is used for the lookup (this is suitable for enrichers having only one config option) * @param defaultVal the default value to use when the no config is set * @return the value looked up or the default value. */ public String get(Configs.Key key, String defaultVal) { String val = configuration.getProcessorConfig().orElse(ProcessorConfig.EMPTY).getConfig(name, key.name()); if (val == null) { String fullKey = ENRICHER_PROP_PREFIX + "." + name + "." + key; val = configuration.getPropertyWithSystemOverride(fullKey); } return val != null ? val : defaultVal; }
/** * Get a config value with a default. If no value is given, as a last resort, project properties are looked up. * * @param key key part to lookup. The whole key is build up from <code>prefix + "." + key</code>. If key is null, * then only the prefix is used for the lookup (this is suitable for enrichers having only one config option) * @param defaultVal the default value to use when the no config is set * @return the value looked up or the default value. */ public String get(Configs.Key key, String defaultVal) { String val = config != null ? config.getConfig(name, key.name()) : null; if (val == null) { String fullKey = WATCHER_PROP_PREFIX + "." + name + "." + key; val = Configs.getPropertyWithSystemAsFallback(projectProperties, fullKey); } return val != null ? val : defaultVal; }
/** * Get a config value with a default. If no value is given, as a last resort, project properties are looked up. * * @param key key part to lookup. The whole key is build up from <code>prefix + "." + key</code>. If key is null, * then only the prefix is used for the lookup (this is suitable for enrichers having only one config option) * @param defaultVal the default value to use when the no config is set * @return the value looked up or the default value. */ public String get(Configs.Key key, String defaultVal) { String val = config != null ? config.getConfig(name, key.name()) : null; if (val == null) { String fullKey = ENRICHER_PROP_PREFIX + "." + name + "." + key; val = Configs.getPropertyWithSystemAsFallback(projectProperties, fullKey); } return val != null ? val : defaultVal; }
/** * Get a config value with a default * @param key key part to lookup. The whole key is build up from <code>prefix + "." + key</code>. If key is null, * then only the prefix is used for the lookup (this is suitable for enrichers having only one config option) * @param defaultVal the default value to use when the no config is set * @return the value looked up or the default value. */ public String get(Configs.Key key, String defaultVal) { String keyVal = key != null ? key.name() : ""; String val = config != null ? config.getConfig(name, key.name()) : null; if (val == null) { String fullKey = GENERATOR_PROP_PREFIX + "." + name + "." + key; val = Configs.getPropertyWithSystemAsFallback(properties, fullKey); } return val != null ? val : defaultVal; }
/** * Get a configuration value * * @param key key to lookup. * @return the configuration value */ public String get(Configs.Key key) { return get(key, key.def()); }
/** * Get a configuration value * * @param key key to lookup. * @return the configuration value */ public String get(Configs.Key key) { return get(key, key.def()); }
/** * Get a configuration value * * @param key key to lookup * @return the value */ public String get(Configs.Key key) { return get(key, key.def()); }
/** * Get a configuration value * * @param key key to lookup. If it implements also {@link DefaultValueProvider} then use this for a default value * @return the defa */ public String get(Configs.Key key) { return get(key, key.def()); }