getEnumWithDefault

fun <E : Enum<E>?> getEnumWithDefault(clazz: Class<E>?, name: String?, defaultValue: E): E

Returns the matching enum instance based on a input string with a default value in case there is no match.

Return

the matching instance of null

Parameters

clazz

the enum class

name

the name of the enum to match

the enum type
defaultValue

the default value