SRJRCFrames
v0.1.296

de.schwarzrot.data.support
Class EnumUtils

java.lang.Object
  extended by de.schwarzrot.data.support.EnumUtils

public class EnumUtils
extends Object

class to convert Enums into storable values or localize Enums names

Author:
Reinhard Mantey

Constructor Summary
EnumUtils()
           
 
Method Summary
static
<E extends Enum<E>>
E
getEnumForOrdinal(Class<E> any, int ordinal)
          gets an enum for the given ordinal
static
<E extends Enum<E>>
String
getLabelFor(E any)
          returns a localized representation for the enum name
 
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

getEnumForOrdinal

public static <E extends Enum<E>> E getEnumForOrdinal(Class<E> any,
                                                      int ordinal)
gets an enum for the given ordinal

Type Parameters:
E - the type of the enum involved
Parameters:
any - the enum class
ordinal - the ordinal for the enum to retrieve
Returns:
returns the found enum or null if the ordinal is not defined in that type

getLabelFor

public static <E extends Enum<E>> String getLabelFor(E any)
returns a localized representation for the enum name

Type Parameters:
E - the type of the involved enum
Parameters:
any - the enum to retrieve a translated name for
Returns:
the found name for the enum. If no localized name is defined, the name of the enum will be returned.

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.