Package com.linkare.commons.utils
Class EnumLocalizeNameHelper<EnumType extends Enum<?>>
- java.lang.Object
-
- com.linkare.commons.utils.EnumLocalizeNameHelper<EnumType>
-
-
Field Summary
Fields Modifier and Type Field Description private static StringMISSING_RESOURCE_DELIMITER
-
Constructor Summary
Constructors Modifier Constructor Description privateEnumLocalizeNameHelper()Hiding constructor so that this utility class cannot be instantiated from outside.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <EnumType extends Enum<?>>
StringgetLocalizedName(EnumType enumType, ResourceBundle bundle)
-
-
-
Field Detail
-
MISSING_RESOURCE_DELIMITER
private static final String MISSING_RESOURCE_DELIMITER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocalizedName
public static <EnumType extends Enum<?>> String getLocalizedName(EnumType enumType, ResourceBundle bundle)
- Type Parameters:
EnumType- the type of the enum whose constant we are looking for.- Parameters:
enumType- the enum constant we are looking for.bundle- the bundle where theenumTypeshould be looked in.- Returns:
- Returns the localized name of the
enumTypein thebundlespecified, if both theenumTypeand thebundleare not null. The bundle key format is'. It returns false otherwise. E.g., for one enum type named Gender, containing MALE and FEMALE as its members:. ' Enum type Searching key MALE Gender.MALE FEMALE Gender.FEMALE
-
-