org.jcoderz.commons
Class Category

java.lang.Object
  extended by org.jcoderz.commons.Category
All Implemented Interfaces:
Serializable, EnumType, StrongType

public final class Category
extends Object
implements Serializable, EnumType

Enumerated type of a category. Instances of this class are immutable. The following categorys are defined:

The values of this enum have a internal sequential integer representation starting with '0'.

Author:
generated
See Also:
Serialized Form

Field Summary
static Category AUDIT
          The Category Audit.
static Category BUSINESS
          The Category Business.
static Category FLOW
          The Category Flow.
static Category SECURITY
          The Category Security.
static Category TECHNICAL
          The Category Technical.
static String TYPE_NAME
          The name of this type.
static Category UNDEFINED
          The Category Undefined.
static Map VALUE_MAP
          Immutable map using the name string as key holding the Categorys as values.
static List VALUES
          Immutable list of the Categorys.
 
Method Summary
static Category fromInt(int i)
          Creates a Category object from its int representation.
static Category fromString(String str)
          Creates a Category object from its String representation.
 int toInt()
          Returns the int representation of this category.
 String toString()
          Returns the String representation of this category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final String TYPE_NAME
The name of this type.

See Also:
Constant Field Values

AUDIT

public static final Category AUDIT
The Category Audit.


BUSINESS

public static final Category BUSINESS
The Category Business.


FLOW

public static final Category FLOW
The Category Flow.


SECURITY

public static final Category SECURITY
The Category Security.


TECHNICAL

public static final Category TECHNICAL
The Category Technical.


UNDEFINED

public static final Category UNDEFINED
The Category Undefined.


VALUES

public static final List VALUES
Immutable list of the Categorys.


VALUE_MAP

public static final Map VALUE_MAP
Immutable map using the name string as key holding the Categorys as values.

Method Detail

fromInt

public static Category fromInt(int i)
                        throws ArgumentMalformedException
Creates a Category object from its int representation.

Parameters:
i - the integer representation of the category.
Returns:
the Category object represented by this int.
Throws:
ArgumentMalformedException - If the assigned int value isn't listed in the internal category table.

fromString

public static Category fromString(String str)
                           throws ArgumentMalformedException
Creates a Category object from its String representation.

Parameters:
str - the string representation of the category.
Returns:
the Category object represented by this str.
Throws:
ArgumentMalformedException - If the given str value isn't listed in the internal category table.

toInt

public int toInt()
Returns the int representation of this category.

Specified by:
toInt in interface EnumType
Returns:
the int representation of this category.

toString

public String toString()
Returns the String representation of this category.

Overrides:
toString in class Object
Returns:
the String representation of this category.


Copyright 2007 The jCoderZ Project.