net.sf.juoserver.model
Class EnumUtils

java.lang.Object
  extended by net.sf.juoserver.model.EnumUtils

public class EnumUtils
extends Object


Constructor Summary
EnumUtils()
           
 
Method Summary
static
<T extends Enum<T> & Coded>
T
byCode(int code, Class<T> clazz)
          Retrieves the enum constant belonging to the specified enum class (clazz) and identified by the provided integer code through the Coded interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumUtils

public EnumUtils()
Method Detail

byCode

public static <T extends Enum<T> & Coded> T byCode(int code,
                                                  Class<T> clazz)
Retrieves the enum constant belonging to the specified enum class (clazz) and identified by the provided integer code through the Coded interface.

null is returned in case the enum type contains no constant that can be identified by the specified code.

Type Parameters:
T - the enum type modeled by the specified enum class clazz
Parameters:
code - the integer code that identifies the enum constant to be returned
clazz - the enum class
Returns:
the enum constant belonging to the specified enum class and identified by the provided integer code, or null if the provided enum contains no such constant


Copyright © 2010-2012. All Rights Reserved.