Class OverriddenConfigurationPropertySource
java.lang.Object
org.hibernate.search.engine.cfg.impl.OverriddenConfigurationPropertySource
- All Implemented Interfaces:
ConfigurationPropertySource
public class OverriddenConfigurationPropertySource
extends Object
implements ConfigurationPropertySource
This class is very similar to
FallbackConfigurationPropertySource.
We could actually use FallbackConfigurationPropertySource wherever we use this class,
simply by inverting the constructor parameters, if it wasn't for one detail:
the implementation of resolve(String) would not work as expected,
returning the key resolved using the wrong source.-
Constructor Summary
ConstructorsConstructorDescriptionOverriddenConfigurationPropertySource(ConfigurationPropertySource main, ConfigurationPropertySource override) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.search.engine.cfg.ConfigurationPropertySource
withFallback, withMask, withOverride, withPrefix
-
Constructor Details
-
OverriddenConfigurationPropertySource
public OverriddenConfigurationPropertySource(ConfigurationPropertySource main, ConfigurationPropertySource override)
-
-
Method Details
-
get
- 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
- 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.
-
toString
-