3

It is possible to define an enumerator with values in String in JDL as follows and with result in Java and Angular

JDL may be

enum LocaleLanguage {
    ES_ES("es_ES"), ES_CA("es_CA"), EN_GB("en_GB"), EN_US("en_US")
    loacle String
}

Java result may be

public enum LocaleLanguage
{
    ES_ES("es_ES"),
    ES_CA("es_CA"),
    EN_GB("en_GB"),
    EN_US("en_US");

    private String locale;

    LanguageLocale(String locale) {
        this.locale = locale;
    }

    public String getLocale() {
        return locale;
    }
}

Angular

export const enum LocaleLanguage {
    ES_ES = 'es_ES',
    ES_CA = 'es_CA',
    EN_GB = 'en_GB',
    EN_US = 'en_US'
}
Marco Osorio
  • 101
  • 8

1 Answers1

0

At this time this is not possible. A way to circumvent this issue would be to use translations and in the front end change the value to the desired String.

Alejandro
  • 766
  • 9
  • 24