Top Description Inners Methods
org.hibernate.engine.config.spi

public Interface ConfigurationService

extends Service
Known Direct Implementers
org.hibernate.engine.config.internal.ConfigurationServiceImpl
Imports
java.util.Map, org.hibernate.service.Service, org.checkerframework.checker.nullness.qual.NonNull, .Nullable, .PolyNull

Provides access to the initial user-provided configuration values. Generally speaking these values come from:
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ConfigurationService.Converter<
The Java type of the converted value
T
>

Simple conversion contract for converting an untyped object to a specified type.

Method Summary

Modifier and TypeMethod and Description
public <
The Java type of the conversion
T
>
@Nullable T

Returns:

The converted (typed) setting. May return null (see getSetting(String, Class, Object))
getSetting
(String
The name of the setting to get.
name
,
ConfigurationService.Converter<T>
The converter to apply
converter
)

Get the named setting, using the specified converter.

public <
The Java type of the conversion
T
>
@PolyNull T

Returns:

The converted (typed) setting. Will be the defaultValue if no such setting was defined.
getSetting
(String
The name of the setting to get.
name
,
ConfigurationService.Converter<T>
The converter to apply
converter
,
@PolyNull T
If no setting with that name is found, return this default value as the result.
defaultValue
)

Get the named setting, using the specified converter and default value.

public <
The Java type of the conversion
T
>
@PolyNull T

Returns:

The converted (typed) setting. Will be the defaultValue if no such setting was defined.
getSetting
(String
The name of the setting to get.
name
,
Class<T>
The expected Java type.
expected
,
@PolyNull T
If no setting with that name is found, return this default value as the result.
defaultValue
)

Get the named setting.

public Map<String, Object>

Returns:

The immutable map of config settings.
getSettings
()

Access to the complete map of config settings.

Method Detail

getSettingback to summary
public <T> @Nullable T getSetting(String name, ConfigurationService.Converter<T> converter)

Get the named setting, using the specified converter.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

converter:ConfigurationService.Converter<T>

The converter to apply

Returns:@Nullable T

The converted (typed) setting. May return null (see getSetting(String, Class, Object))

getSettingback to summary
public <T> @PolyNull T getSetting(String name, ConfigurationService.Converter<T> converter, @PolyNull T defaultValue)

Get the named setting, using the specified converter and default value.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

converter:ConfigurationService.Converter<T>

The converter to apply

defaultValue:@PolyNull T

If no setting with that name is found, return this default value as the result.

Returns:@PolyNull T

The converted (typed) setting. Will be the defaultValue if no such setting was defined.

getSettingback to summary
public <T> @PolyNull T getSetting(String name, Class<T> expected, @PolyNull 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.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

expected:Class<T>

The expected Java type.

defaultValue:@PolyNull T

If no setting with that name is found, return this default value as the result.

Returns:@PolyNull T

The converted (typed) setting. Will be the defaultValue if no such setting was defined.

getSettingsback to summary
public Map<String, Object> getSettings()

Access to the complete map of config settings. The returned map is immutable

Returns:Map<String, Object>

The immutable map of config settings.

org.hibernate.engine.config.spi back to summary

public Interface ConfigurationService.Converter<T>

Known Direct Implementers
org.hibernate.internal.util.config.ConfigurationHelper.TypeCodeConverter
Type Parameters
<T>
The Java type of the converted value

Simple conversion contract for converting an untyped object to a specified type.

Method Summary

Modifier and TypeMethod and Description
public @NonNull T

Returns:

The converted (typed) value.
convert
(Object
The untyped value
value
)

Convert an untyped Object reference to the Converter's type.

Method Detail

convertback to summary
public @NonNull T convert(Object value)

Convert an untyped Object reference to the Converter's type.

Parameters
value:Object

The untyped value

Returns:@NonNull T

The converted (typed) value.