Package org.hibernate.engine.config.spi
Interface ConfigurationService
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ConfigurationService.Converter<T>
Simple conversion contract for converting an untyped object to a specified type.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <T> T
cast(java.lang.Class<T> expected, java.lang.Object candidate)
Deprecated.No idea why this is exposed here...<T> T
getSetting(java.lang.String name, java.lang.Class<T> expected, T defaultValue)
Get the named setting.<T> T
getSetting(java.lang.String name, ConfigurationService.Converter<T> converter)
Get the named setting, using the specified converter.<T> T
getSetting(java.lang.String name, ConfigurationService.Converter<T> converter, T defaultValue)
Get the named setting, using the specified converter and default value.java.util.Map
getSettings()
Access to the complete map of config settings.
-
-
-
Method Detail
-
getSettings
java.util.Map getSettings()
Access to the complete map of config settings. The returned map is immutable- Returns:
- The immutable map of config settings.
-
getSetting
<T> T getSetting(java.lang.String name, ConfigurationService.Converter<T> converter)
Get the named setting, using the specified converter.- Type Parameters:
T
- The Java type of the conversion- Parameters:
name
- The name of the setting to get.converter
- The converter to apply- Returns:
- The converted (typed) setting. May return
null
(seegetSetting(String, Class, Object)
)
-
getSetting
<T> T getSetting(java.lang.String name, ConfigurationService.Converter<T> converter, T defaultValue)
Get the named setting, using the specified converter and default value.- Type Parameters:
T
- The Java type of the conversion- Parameters:
name
- The name of the setting to get.converter
- The converter to applydefaultValue
- If no setting with that name is found, return this default value as the result.- Returns:
- The converted (typed) setting. Will be the defaultValue if no such setting was defined.
-
getSetting
<T> T getSetting(java.lang.String name, java.lang.Class<T> expected, T defaultValue)
Get the named setting. Differs from the form taking a Converter in that here we expect to have a simple cast rather than any involved conversion.- Type Parameters:
T
- The Java type of the conversion- Parameters:
name
- The name of the setting to get.expected
- The expected Java type.defaultValue
- If no setting with that name is found, return this default value as the result.- Returns:
- The converted (typed) setting. Will be the defaultValue if no such setting was defined.
-
cast
@Deprecated <T> T cast(java.lang.Class<T> expected, java.lang.Object candidate)
Deprecated.No idea why this is exposed here...Cast candidate to the instance of expected type.- Type Parameters:
T
- The java type of the expected return- Parameters:
expected
- The type of instance expected to return.candidate
- The candidate object to be casted.- Returns:
- The instance of expected type or null if this cast fail.
-
-