Package mc.core.model.i18n
Class Locale
java.lang.Object
mc.core.model.base.EntityBase
mc.core.model.base.SimpleEntity
mc.core.model.i18n.Locale
- All Implemented Interfaces:
Serializable,IBaseEntity,ICoreEntity,IEntity,ISortableEntity
Entity representing a locale, a localized language. Locale is always associated with a language an can optionally
have a country and an extension.
Special languages in the system (signaled by internalDescription):
iso2Code: lower case 2-letter code according to ISO standard, must be unique for all languagesiso2Code: lower case 3-letter code according to ISO standard, should be unique for all languages, but
this is not enforced by databaseSpecial 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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class mc.core.model.base.EntityBase
EntityBase.EntityComparator, EntityBase.Param -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringfor single language resourcesFields inherited from class mc.core.model.base.EntityBase
INTDESC_COLUMN_LENGTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionVariant.booleanvoidsetCountry(Country country) voidsetExtension(String extension) voidsetIsUILocale(boolean isUILocale) voidsetLanguage(Language language) toString()for debugging/loggingMethods inherited from class mc.core.model.base.SimpleEntity
getId, getIsActive, setId, setIsActiveMethods inherited from class mc.core.model.base.EntityBase
equals, getCollection, getDescription, getDescription, getFlag, getIsSystem, getName, getName, getNamespace, getPrio, hashCode, setCollection, setDescription, setDescription, setFlag, setInternalDescription, setIsSystem, setName, setName, setNamespace, setPrio
-
Field Details
-
DEFAULT
- See Also:
-
UNDEFINED
for single language resources- See Also:
-
-
Constructor Details
-
Locale
public Locale()standard constructor -
Locale
-
Locale
-
Locale
constructor for default and undefined locale
-
-
Method Details
-
getCountry
-
getExtension
Variant. -
getInternalDescription
- Specified by:
getInternalDescriptionin interfaceIEntity- Overrides:
getInternalDescriptionin classSimpleEntity- Returns:
- Unique identifier in combination with entity class if internalDescription property is defined as unique.
Might be
null.
-
getLanguage
-
setCountry
-
setExtension
-
setLanguage
-
getIsUILocale
public boolean getIsUILocale() -
setIsUILocale
public void setIsUILocale(boolean isUILocale) -
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
for debugging/logging- Overrides:
toStringin classEntityBase- Returns:
- the String representation of this locale
-