[Minor] Converted SupportedLanguage to a record
This commit is contained in:
parent
2eeb465041
commit
a6aebc7288
|
@ -1,19 +1,5 @@
|
|||
package li.strolch.runtime.configuration;
|
||||
|
||||
public class SupportedLanguage {
|
||||
private final String locale;
|
||||
private final String name;
|
||||
public record SupportedLanguage(String locale, String name) {
|
||||
|
||||
public SupportedLanguage(String locale, String name) {
|
||||
this.locale = locale;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getLocale() {
|
||||
return locale;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ public class Languages {
|
|||
.getStrolchConfiguration().getRuntimeConfiguration().getSupportedLanguages();
|
||||
JsonArray result = supportedLanguages.stream().map(language -> {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty(Tags.Json.LOCALE, language.getLocale());
|
||||
jsonObject.addProperty(Tags.Json.NAME, language.getName());
|
||||
jsonObject.addProperty(Tags.Json.LOCALE, language.locale());
|
||||
jsonObject.addProperty(Tags.Json.NAME, language.name());
|
||||
return jsonObject;
|
||||
}).collect(JsonArray::new, JsonArray::add, JsonArray::addAll);
|
||||
|
||||
|
|
Loading…
Reference in New Issue