Class EmptyConfigurationPropertySource
- java.lang.Object
-
- org.hibernate.search.engine.cfg.impl.EmptyConfigurationPropertySource
-
- All Implemented Interfaces:
ConfigurationPropertySource
public class EmptyConfigurationPropertySource extends Object implements ConfigurationPropertySource
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConfigurationPropertySourceget()Optional<Object>get(String key)Optional<String>resolve(String key)StringtoString()ConfigurationPropertySourcewithFallback(ConfigurationPropertySource fallback)Create a new configuration source which falls back to another source when a property is missing in this source.ConfigurationPropertySourcewithMask(String mask)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.engine.cfg.ConfigurationPropertySource
withOverride, withPrefix
-
-
-
-
Method Detail
-
get
public static ConfigurationPropertySource get()
-
get
public Optional<Object> get(String key)
- Specified by:
getin interfaceConfigurationPropertySource- Parameters:
key- The key of the property to get.- Returns:
- An optional containing the value of the requested property,
or
Optional.empty()if the property is missing.
-
resolve
public Optional<String> resolve(String key)
- Specified by:
resolvein interfaceConfigurationPropertySource- Parameters:
key- The key of the property to get.- Returns:
- An optional containing the key as registered in the underlying configuration source,
with any transformation (
prefixes,masks) reverted. Whether the optional is empty is not related to the key having a value in the underlying configuration source; instead, the optional is empty only if the key cannot possibly be registered in the underlying configuration source, e.g. if the key is missing a mandatory prefix.
-
withMask
public ConfigurationPropertySource withMask(String mask)
- Specified by:
withMaskin interfaceConfigurationPropertySource- Parameters:
mask- A mask to filter the properties with.- Returns:
- A source containing only the properties of this source that start with the given mask plus ".".
-
withFallback
public ConfigurationPropertySource withFallback(ConfigurationPropertySource fallback)
Description copied from interface:ConfigurationPropertySourceCreate a new configuration source which falls back to another source when a property is missing in this source.main.withFallback( fallback )is equivalent tofallback.withOverride( main )except for one detail: in the first example, a call toConfigurationPropertySource.resolve(String)on the resulting source will resolve the key againstmain, but in the second example it will resolve the key againstoverride.- Specified by:
withFallbackin interfaceConfigurationPropertySource- Parameters:
fallback- A fallback source.- Returns:
- A source containing the same properties as this source, plus any property from
fallbackthat isn't in this source.
-
-