enumFrom

open fun <T : Enum<T>?, GraphQLEnum?> enumFrom(clazz: Class<T>, value: String): T(source)

Convert a string value to an enum constant. This is a helper method for working with generated enum types that implement this interface.

Return

The enum constant with the given name

Parameters

clazz

The enum class

value

The string value of the enum constant

<T>

The enum type that implements both java.lang.Enum and viaduct.java.api.types.Enum

Throws

if no enum constant with the given name exists