December 2019
Intermediate to advanced
314 pages
6h 51m
English
If the list of built-in converters is not enough, you can still create custom converters by implementing the generic interface, that is, org.eclipse.microprofile.config.spi.Converter. The Type parameter of the interface is the target type the string is converted into:
public class MicroProfileCustomValueConverter implements Converter<CustomConfigValue> { public MicroProfileCustomValueConverter() { } @Override public CustomConfigValue convert(String value) { return new CustomConfigValue(value); }}
The following code is for the target Type parameter, which derives from a plain Java string that we have included in the configuration:
public class CustomConfigValue { private final String email; private final String
Read now
Unlock full access