country:
countryConfig:
aue:
- lang: zh
isDefault: true
- lang: en
isDefault: false
hk:
- lang: zh
isDefault: true
上述所对应的java类为:
@Component
@ConfigurationProperties(prefix = "country")
@Data
public class CountryConfig {
private Map<String, Set<LanguageConfig>> countryConfig;
}
@Data
class LanguageConfig {
private String lang;
private boolean isDefault;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != ()) return false;
LanguageConfig that = (LanguageConfig) o;
return (lang, );
}
@Override
public int hashCode() {
return (lang);
}
}