Package org.hibernate.engine.config.spi
Interface ConfigurationService
- All Superinterfaces:
Serializable
,Service
- All Known Implementing Classes:
ConfigurationServiceImpl
Provides access to the initial user-provided configuration values. Generally speaking
these values come from:
- Calls to
StandardServiceRegistryBuilder.loadProperties(java.lang.String)
- Calls to
StandardServiceRegistryBuilder.applySetting(java.lang.String, java.lang.Object)
- Calls to
StandardServiceRegistryBuilder.applySettings(java.util.Map<java.lang.String, java.lang.Object>)
- Calls to
StandardServiceRegistryBuilder.configure()
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Simple conversion contract for converting an untyped object to a specified type. -
Method Summary
Modifier and TypeMethodDescription<T> @PolyNull T
getSetting
(String name, Class<T> expected, @PolyNull T defaultValue) Get the named setting.<T> @Nullable T
getSetting
(String name, ConfigurationService.Converter<T> converter) Get the named setting, using the specified converter.<T> @PolyNull T
getSetting
(String name, ConfigurationService.Converter<T> converter, @PolyNull T defaultValue) Get the named setting, using the specified converter and default value.Access to the complete map of config settings.
-
Method Details
-
getSettings
Access to the complete map of config settings. The returned map is immutable- Returns:
- The immutable map of config settings.
-
getSetting
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> @PolyNull T getSetting(String name, ConfigurationService.Converter<T> converter, @PolyNull 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
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.
-