I have a dropwizard application that parses conf files to construct the application's configuration.
base.conf file has:
country: USA
in the configuration java file:
@NotNull
private MyObject country;
MyObject is not an enum in this case. It is a regular object.
How can I configure it to have dropwizard automatically convert the parsed string value to MyObject based on some logic I define, like:
MyObject convertStringToMyObject(String value) {
if (value.equals("USA") {
return new MyObject("+1", "North America", "USA");
}
}
This is obviously just the simplest dumb sample I could think of for what I'm trying to achieve.