Class ConfigSourceProvider.ConverterRegistration<T>
java.lang.Object
org.microbean.loader.microprofile.config.configsource.ConfigSourceProvider.ConverterRegistration<T>
- All Implemented Interfaces:
Serializable
,Converter<T>
- Enclosing class:
- ConfigSourceProvider
public static final class ConfigSourceProvider.ConverterRegistration<T>
extends Object
implements Converter<T>
A coupling of a
Type
, a priority (as defined in the MicroProfile
Config specification), and a Converter
.
For convenience, this class also implements the Converter
interface itself.
- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorDescriptionConverterRegistration
(Type type, int priority, Converter<? extends T> converter) Creates a newConfigSourceProvider.ConverterRegistration
.ConverterRegistration
(Type type, Converter<? extends T> converter) Creates a newConfigSourceProvider.ConverterRegistration
with a priority of100
, following the conventions of the MicroProfile Config specification -
Method Summary
Modifier and TypeMethodDescriptionfinal T
Converts the suppliedString
-typed configuration value to the conversion type supplied at construction time using theConverter
supplied at construction time and returns the result of the conversion.final int
priority()
Returns the priority of thisConfigSourceProvider.ConverterRegistration
.final Type
type()
Returns the conversion type of thisConfigSourceProvider.ConverterRegistration
.
-
Constructor Details
-
ConverterRegistration
Creates a newConfigSourceProvider.ConverterRegistration
with a priority of100
, following the conventions of the MicroProfile Config specification- Parameters:
type
- the conversion type; must not benull
converter
- theConverter
; must not benull
- See Also:
-
ConverterRegistration
Creates a newConfigSourceProvider.ConverterRegistration
.- Parameters:
type
- the conversion type; must not benull
priority
- the priority (as defined in the MicroProfile Config specification)converter
- theConverter
; must not benull
-
-
Method Details
-
type
Returns the conversion type of thisConfigSourceProvider.ConverterRegistration
.- Returns:
- the conversion type
- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
priority
Returns the priority of thisConfigSourceProvider.ConverterRegistration
.- Returns:
- the priority
- Idempotency:
- This method is idempotent and deterministic.
- Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
convert
Converts the suppliedString
-typed configuration value to the conversion type supplied at construction time using theConverter
supplied at construction time and returns the result of the conversion.- Specified by:
convert
in interfaceConverter<T>
- Parameters:
configurationValue
- the value to convert; must not benull
- Returns:
- the conversion
- Throws:
NullPointerException
- ifconfigurationValue
isnull
IllegalArgumentException
- if conversion could not occur for any reason- See Also:
- Idempotency:
- No guarantees are made about idempotency or determinism.
- Nullability:
- This method may return
null
. - Thread Safety:
- No guarantees are made about thread safety.
-