Package nz.org.riskscape.engine.i18n
Class EnumTranslator
java.lang.Object
nz.org.riskscape.engine.i18n.EnumTranslator
Helper for handling translation of Enum values for user help, CLI display, etc.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
EnumTranslator.EnumEntry<T extends Enum<?>>
Handles accessing translated strings for a specific enum value -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Enum<?>>
List<EnumTranslator.EnumEntry<T>>getEntries
(Class<T> enumClass) <T extends Enum<?>>
EnumTranslator.EnumEntry<T>getEntry
(T enumValue)
-
Constructor Details
-
EnumTranslator
public EnumTranslator(nz.org.riskscape.engine.i18n.TranslationContext context)
-
-
Method Details
-
getEntries
- Returns:
- a list of
EnumTranslator.EnumEntry
s that correspond to the constants/values for the given enum. This makes it easier to access/display the translated text for an enum.
-
getEntry
- Returns:
- a single EnumEntry for the given enumValue, linked to this EnumTranslator's i18n state.
-