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
ConstructorsConstructorDescriptionConverterRegistration(Type type, int priority, Converter<? extends T> converter) Creates a newConfigSourceProvider.ConverterRegistration.ConverterRegistration(Type type, Converter<? extends T> converter) Creates a newConfigSourceProvider.ConverterRegistrationwith a priority of100, following the conventions of the MicroProfile Config specification -
Method Summary
Modifier and TypeMethodDescriptionfinal TConverts the suppliedString-typed configuration value to the conversion type supplied at construction time using theConvertersupplied at construction time and returns the result of the conversion.final intpriority()Returns the priority of thisConfigSourceProvider.ConverterRegistration.final Typetype()Returns the conversion type of thisConfigSourceProvider.ConverterRegistration.
-
Constructor Details
-
ConverterRegistration
Creates a newConfigSourceProvider.ConverterRegistrationwith a priority of100, following the conventions of the MicroProfile Config specification- Parameters:
type- the conversion type; must not benullconverter- theConverter; must not benull- See Also:
-
ConverterRegistration
Creates a newConfigSourceProvider.ConverterRegistration.- Parameters:
type- the conversion type; must not benullpriority- 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 theConvertersupplied at construction time and returns the result of the conversion.- Specified by:
convertin interfaceConverter<T>- Parameters:
configurationValue- the value to convert; must not benull- Returns:
- the conversion
- Throws:
NullPointerException- ifconfigurationValueisnullIllegalArgumentException- 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.
-