Top Description Constructors Methods
org.apache.logging.log4j.util

public final Class EnglishEnums

extends Object
Class Inheritance
Annotations
@InternalApi
Static Imports
org.apache.logging.log4j.util.Strings.toRootUpperCase

Consider 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

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <
The type of the enum.
T extends Enum<T>
>
T

Returns:

an enum value or null if name is null.
valueOf
(final Class<T>
The Class of the enum.
enumType
,
final String
The enum name, case-insensitive. If null, returns defaultValue.
name
)

Returns the Result for the given string.

public static <
The type of the enum.
T extends Enum<T>
>
T

Returns:

an enum value or defaultValue if name is null.
valueOf
(final Class<T>
The Class of the enum.
enumType
,
final String
The enum name, case-insensitive. If null, returns defaultValue.
name
,
final T
the enum value to return if name is null.
defaultValue
)

Returns an enum value for the given string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EnglishEnumsback to summary
private EnglishEnums()

Method Detail

valueOfback to summary
public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name)

Returns the Result for the given string.

The name is converted internally to upper case with the ENGLISH locale to avoid problems on the Turkish locale. Do not use with Turkish enum values.

Parameters
<T>
The type of the enum.
enumType:Class<T>

The Class of the enum.

name:String

The enum name, case-insensitive. If null, returns defaultValue.

Returns:T

an enum value or null if name is null.

valueOfback to summary
public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name, final T defaultValue)

Returns an enum value for the given string.

The name is converted internally to upper case with the ENGLISH locale to avoid problems on the Turkish locale. Do not use with Turkish enum values.

Parameters
<T>
The type of the enum.
enumType:Class<T>

The Class of the enum.

name:String

The enum name, case-insensitive. If null, returns defaultValue.

defaultValue:T

the enum value to return if name is null.

Returns:T

an enum value or defaultValue if name is null.