Class Locale

All Implemented Interfaces:
Serializable, IBaseEntity, ICoreEntity, IEntity, ISortableEntity

@Entity public class Locale extends SimpleEntity
Entity representing a locale, a localized language. Locale is always associated with a language an can optionally have a country and an extension.
iso2Code: lower case 2-letter code according to ISO standard, must be unique for all languages
iso2Code: lower case 3-letter code according to ISO standard, should be unique for all languages, but this is not enforced by database
Special languages in the system (signaled by internalDescription):
  • DEFAULT_LOCALE: there can only be one locale marked as default, the locale referencing the default language without country and extension
  • UNDEFINED_LOCALE: locale used for locale independent data where database requires a locale, references the undefined language
See Also:
  • Field Details

  • Constructor Details

    • Locale

      public Locale()
      standard constructor
    • Locale

      public Locale(Language language)
    • Locale

      public Locale(Language language, Country country)
    • Locale

      public Locale(Language language, String internalDescription)
      constructor for default and undefined locale
  • Method Details

    • getCountry

      public Country getCountry()
    • getExtension

      public String getExtension()
      Variant.
    • getInternalDescription

      public String getInternalDescription()
      Specified by:
      getInternalDescription in interface IEntity
      Overrides:
      getInternalDescription in class SimpleEntity
      Returns:
      Unique identifier in combination with entity class if internalDescription property is defined as unique. Might be null.
    • getLanguage

      public Language getLanguage()
    • setCountry

      public void setCountry(Country country)
    • setExtension

      public void setExtension(String extension)
    • setLanguage

      public void setLanguage(Language language)
    • getIsUILocale

      public boolean getIsUILocale()
    • setIsUILocale

      public void setIsUILocale(boolean isUILocale)
    • getJavaLocale

      public Locale getJavaLocale()
      Returns:
      the java-Locale equivalent to this Locale, created from isocodes of language and country if exists and extension if exists. Locale must be attached!
    • toString

      public String toString()
      for debugging/logging
      Overrides:
      toString in class EntityBase
      Returns:
      the String representation of this locale