com.google.common.base
Class Enums

java.lang.Object
  extended by com.google.common.base.Enums

@GwtCompatible
@Beta
public final class Enums
extends java.lang.Object

Utility methods for working with Enum instances.

Since:
9

Method Summary
static
<T extends java.lang.Enum<T>>
Function<java.lang.String,T>
valueOfFunction(java.lang.Class<T> enumClass)
          Returns a Function that maps an Enum name to the associated Enum constant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

valueOfFunction

public static <T extends java.lang.Enum<T>> Function<java.lang.String,T> valueOfFunction(java.lang.Class<T> enumClass)
Returns a Function that maps an Enum name to the associated Enum constant. The Function will return null if the Enum constant does not exist.

Parameters:
enumClass - the Class of the Enum declaring the constant values.