Interface OptionalConfigurationProperty<T>
- All Superinterfaces:
ConfigurationProperty<Optional<T>>
-
Method Summary
Modifier and TypeMethodDescription<R> Optional<R>
getAndMap
(ConfigurationPropertySource source, Function<T, R> transform) Get and transform the value of this configuration property.<R> R
getAndMapOrThrow
(ConfigurationPropertySource source, Function<T, R> transform, Supplier<RuntimeException> exceptionSupplier) Get and transform the value of this configuration property, throwing an exception if the value is not present.getOrThrow
(ConfigurationPropertySource source, Supplier<RuntimeException> exceptionSupplier) Get the value of this configuration property, throwing an exception if the value is not present.Methods inherited from interface org.hibernate.search.engine.cfg.spi.ConfigurationProperty
get, getAndTransform, resolve, resolveOrRaw
-
Method Details
-
getAndMap
Get and transform the value of this configuration property.Similar to calling
ConfigurationProperty.getAndTransform(ConfigurationPropertySource, Function)
, but easier to use, since the transform function is applied to the content of the optional, not to the optional itself.Any exception occurring during transformation will be wrapped in another exception adding some context, such as the
resolved key
for this property.- Type Parameters:
R
- The transformed type.- Parameters:
source
- A configuration source.transform
- A transform function to be applied to the value of this configuration property before returning the result.- Returns:
- The value of this property according to the given source.
-
getOrThrow
Get the value of this configuration property, throwing an exception if the value is not present.- Parameters:
source
- A configuration source.exceptionSupplier
- A supplier that will be called to create an exception if the value is missing. to create an exception if the value is missing.- Returns:
- The value of this property according to the given source.
-
getAndMapOrThrow
<R> R getAndMapOrThrow(ConfigurationPropertySource source, Function<T, R> transform, Supplier<RuntimeException> exceptionSupplier) Get and transform the value of this configuration property, throwing an exception if the value is not present.Any exception occurring during transformation will be wrapped in another exception adding some context, such as the
resolved key
for this property.- Type Parameters:
R
- The transformed type.- Parameters:
source
- A configuration source.transform
- A transform function to be applied to the value of this configuration property before returning the result.exceptionSupplier
- A supplier that will be called to create an exception if the value is missing.- Returns:
- The value of this property according to the given source.
-