Package org.apache.logging.log4j.util
Class EnglishEnums
- java.lang.Object
-
- org.apache.logging.log4j.util.EnglishEnums
-
public final class EnglishEnums extends java.lang.ObjectConsider this class private.Helps convert English Strings to English Enum values.
Enum name arguments are converted internally to upper case with the ENGLISH locale to avoid problems on the Turkish locale. Do not use with Turkish enum values.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateEnglishEnums()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends java.lang.Enum<T>>
TvalueOf(java.lang.Class<T> enumType, java.lang.String name)Returns the Result for the given string.static <T extends java.lang.Enum<T>>
TvalueOf(java.lang.Class<T> enumType, java.lang.String name, T defaultValue)Returns an enum value for the given string.
-
-
-
Method Detail
-
valueOf
public static <T extends java.lang.Enum<T>> T valueOf(java.lang.Class<T> enumType, java.lang.String name)Returns the Result for the given string.The
nameis converted internally to upper case with the ENGLISH locale to avoid problems on the Turkish locale. Do not use with Turkish enum values.- Type Parameters:
T- The type of the enum.- Parameters:
enumType- The Class of the enum.name- The enum name, case-insensitive. If null, returnsdefaultValue.- Returns:
- an enum value or null if
nameis null.
-
valueOf
public static <T extends java.lang.Enum<T>> T valueOf(java.lang.Class<T> enumType, java.lang.String name, T defaultValue)Returns an enum value for the given string.The
nameis converted internally to upper case with the ENGLISH locale to avoid problems on the Turkish locale. Do not use with Turkish enum values.- Type Parameters:
T- The type of the enum.- Parameters:
name- The enum name, case-insensitive. If null, returnsdefaultValue.enumType- The Class of the enum.defaultValue- the enum value to return ifnameis null.- Returns:
- an enum value or
defaultValueifnameis null.
-
-