Skip to content

Instantly share code, notes, and snippets.

@jeffscottbrown
Created September 24, 2021 14:27
Show Gist options
  • Select an option

  • Save jeffscottbrown/9e51efe95119505e1bfbb297e5927e09 to your computer and use it in GitHub Desktop.

Select an option

Save jeffscottbrown/9e51efe95119505e1bfbb297e5927e09 to your computer and use it in GitHub Desktop.
import io.micronaut.context.annotation.ConfigurationProperties;
import io.micronaut.context.annotation.EachProperty;
import java.util.List;
@ConfigurationProperties("server")
public class CountryConfig {
private List<CountryProps> list;
public List<CountryProps> getSettings() {
return list;
}
public void setSettings(List<CountryProps> list) {
this.list = list;
}
@EachProperty(list=true, value = "settings")
public static class CountryProps {
private String country;
private String host;
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment