Class ConfigurationServiceImpl
- java.lang.Object
-
- org.hibernate.engine.config.internal.ConfigurationServiceImpl
-
- All Implemented Interfaces:
Serializable,ConfigurationService,Service,ServiceRegistryAwareService
public class ConfigurationServiceImpl extends Object implements ConfigurationService, ServiceRegistryAwareService
The standardConfigurationServiceimplementation.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.engine.config.spi.ConfigurationService
ConfigurationService.Converter<T>
-
-
Constructor Summary
Constructors Constructor Description ConfigurationServiceImpl(Map<String,Object> settings)Constructs a ConfigurationServiceImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> @Nullable Tcast(Class<T> expected, @Nullable Object candidate)<T> @PolyNull TgetSetting(String name, Class<T> expected, @PolyNull T defaultValue)Get the named setting.<T> @Nullable TgetSetting(String name, ConfigurationService.Converter<T> converter)Get the named setting, using the specified converter.<T> @PolyNull TgetSetting(String name, ConfigurationService.Converter<T> converter, @PolyNull T defaultValue)Get the named setting, using the specified converter and default value.Map<String,Object>getSettings()Access to the complete map of config settings.voidinjectServices(ServiceRegistryImplementor serviceRegistry)Callback to inject the registry.
-
-
-
Method Detail
-
getSettings
public Map<String,Object> getSettings()
Description copied from interface:ConfigurationServiceAccess to the complete map of config settings. The returned map is immutable- Specified by:
getSettingsin interfaceConfigurationService- Returns:
- The immutable map of config settings.
-
injectServices
public void injectServices(ServiceRegistryImplementor serviceRegistry)
Description copied from interface:ServiceRegistryAwareServiceCallback to inject the registry.- Specified by:
injectServicesin interfaceServiceRegistryAwareService- Parameters:
serviceRegistry- The registry
-
getSetting
public <T> @Nullable T getSetting(String name, ConfigurationService.Converter<T> converter)
Description copied from interface:ConfigurationServiceGet the named setting, using the specified converter.- Specified by:
getSettingin interfaceConfigurationService- 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(seeConfigurationService.getSetting(String, Class, Object))
-
getSetting
public <T> @PolyNull T getSetting(String name, ConfigurationService.Converter<T> converter, @PolyNull T defaultValue)
Description copied from interface:ConfigurationServiceGet the named setting, using the specified converter and default value.- Specified by:
getSettingin interfaceConfigurationService- 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
public <T> @PolyNull T getSetting(String name, Class<T> expected, @PolyNull T defaultValue)
Description copied from interface:ConfigurationServiceGet 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.- Specified by:
getSettingin interfaceConfigurationService- 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.
-
-