public class EnumUtils extends Object
| Constructor and Description |
|---|
EnumUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <E extends Enum<E>> |
enumValueFromProperty(String propertyName,
E[] values,
E defaultValue)
Obtain an enum value by looking up the name in a given property, defaulting if necessary.
|
public static <E extends Enum<E>> E enumValueFromProperty(String propertyName, E[] values, E defaultValue)
propertyName - the name of the property containing the stringified enum value.values - the value of the enumeration, usually E.values().defaultValue - the value to default to if the property is unset or does not match E.name() for some element
of values.defaultValue otherwise.Copyright © 2019 Atlassian. All rights reserved.