valueOf

Returns the enum constant of the specified enum type with the specified name. The name must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

<p>Note that for a particular enum type {@code T}, the implicitly declared {@code static T valueOf(string)} method on that enum may be used instead of this method to map from a name to the corresponding enum constant. All the constants of an enum type can be obtained by calling the implicit {@code static T[] values()} method of that type.

@param <T> The enum type whose constant is to be returned @param enumType the {@code Class} object of the enum type from which to return a constant @param name the name of the constant to return @return the enum constant of the specified enum type with the specified name @throws IllegalArgumentException if the specified enum type has no constant with the specified name, or the specified class object does not represent an enum type

T
valueOf
(
T
)
(
string name
,
T defaultValue = T.init
)
if (
is(T : Enum!(T))
)

Meta