com.google.common.base
Class Enums

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

@GwtCompatible
@Beta
public final class Enums
extends Object

Utility methods for working with Enum instances.

Since:
9.0
Author:
Steve McKay

Method Summary
static
<T extends Enum<T>>
Function<String,T>
valueOfFunction(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 Enum<T>> Function<String,T> valueOfFunction(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.


Copyright © 2010-2011. All Rights Reserved.