[Monitor Service | master]: Stakeholder.java: Added field private Locale locale = Locale.EU; (Local is enum with values: EN("en"), EU("eu")) and getter/setter methods.

This commit is contained in:
Konstantina Galouni 2023-06-19 13:28:32 +03:00
parent f246e4d6b8
commit 0184da8a8e
1 changed files with 26 additions and 0 deletions

View File

@ -14,6 +14,16 @@ enum StakeholderType
FUNDER, RI, PROJECT, ORGANIZATION;
}
enum Locale {
EN("en"), EU("eu");
public final String label;
private Locale(String label) {
this.label = label;
}
}
public class Stakeholder<StringOrTopic> {
@Id
@ -31,6 +41,7 @@ public class Stakeholder<StringOrTopic> {
private String alias;
private String description;
private String defaultId = null;
private Locale locale = Locale.EU;
private Visibility visibility = Visibility.PRIVATE;
private Date creationDate;
private Date updateDate;
@ -53,6 +64,7 @@ public class Stakeholder<StringOrTopic> {
alias = stakeholder.getAlias();
description = stakeholder.getDescription();
defaultId = stakeholder.getDefaultId();
setLocale(stakeholder.getLocale());
setVisibility(stakeholder.getVisibility());
creationDate = stakeholder.getCreationDate();
updateDate = stakeholder.getUpdateDate();
@ -166,6 +178,20 @@ public class Stakeholder<StringOrTopic> {
this.defaultId = defaultId;
}
public String getLocale() {
return locale.label;
}
public void setLocale(String label) {
Locale locale = null;
for (Locale l : Locale.values()) {
if (l.label.equals(label)) {
locale = l;
}
}
this.locale = locale;
}
public Visibility getVisibility() {
//return visibility.getLabel();
return visibility;