[Minor] Converted SupportedLanguage to a record

This commit is contained in:
Robert von Burg 2023-06-12 08:20:08 +02:00
parent 2eeb465041
commit a6aebc7288
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
2 changed files with 3 additions and 17 deletions

View File

@ -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;
}
}

View File

@ -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);