Package nz.org.riskscape.engine.i18n
Class EnumTranslator.EnumEntry<T extends Enum<?>>
java.lang.Object
nz.org.riskscape.engine.i18n.EnumTranslator.EnumEntry<T>
- Enclosing class:
- EnumTranslator
Handles accessing translated strings for a specific enum value
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleangetCode()getDescription(Object... args) Returns a translated 'label' string for this enum.getLabelOr(String defaultMessage, Object... args) Same asgetLabel(Object...)except thedefaultMessagewill be used (rather than theEnum.name()if no i18n message was found.getValue()The enum value itselfinthashCode()toString()
-
Constructor Details
-
EnumEntry
Creates a new
EnumEntryinstance.- Parameters:
value- The enum value itself
-
-
Method Details
-
getLabel
Returns a translated 'label' string for this enum. If no i18n message was found, then the
Enum.name()is used (changed to lower-case hyphens, so it looks more parameter-esque). -
getLabelOr
Same as
getLabel(Object...)except thedefaultMessagewill be used (rather than theEnum.name()if no i18n message was found. -
getCode
- Returns:
- the base i18n code for this enum value
-
getDescription
- Returns:
- a more detailed description for the enum value, e.g. help associated with what it is or does.
-
getValue
The enum value itself
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-