org.jboss.reflect.plugins
Class EnumValueImpl

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.reflect.spi.AbstractValue
          extended by org.jboss.reflect.plugins.EnumValueImpl
All Implemented Interfaces:
Serializable, Cloneable, EnumValue, Value, org.jboss.util.JBossInterface

public class EnumValueImpl
extends AbstractValue
implements EnumValue

An enumeration value

Author:
Bill Burke, Adrian Brock
See Also:
Serialized Form

Field Summary
protected  int hash
          The hash code
protected  TypeInfo type
          The type
protected  String value
          The value
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
EnumValueImpl()
          Create a new EnumValue.
EnumValueImpl(TypeInfo type, String value)
          Create a new EnumValue.
 
Method Summary
protected  void calculateHash()
          Calculate the hash code
 boolean equals(Object o)
           
 TypeInfo getType()
          Get the type of the value
 String getValue()
          Get the value
 int hashCode()
           
 boolean isEnum()
          Is this value an enum
 
Methods inherited from class org.jboss.reflect.spi.AbstractValue
asAnnotation, asArray, asClass, asEnum, asPrimitive, asString, isAnnotation, isArray, isClass, isPrimitive, isString
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, list, notEqual, toShortString, toShortString, toString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.reflect.spi.Value
asAnnotation, asArray, asClass, asEnum, asPrimitive, asString, isAnnotation, isArray, isClass, isPrimitive, isString
 

Field Detail

type

protected TypeInfo type
The type


value

protected String value
The value


hash

protected int hash
The hash code

Constructor Detail

EnumValueImpl

public EnumValueImpl()
Create a new EnumValue.


EnumValueImpl

public EnumValueImpl(TypeInfo type,
                     String value)
Create a new EnumValue.

Parameters:
type - the type
value - the value
Method Detail

isEnum

public boolean isEnum()
Description copied from interface: Value
Is this value an enum

Specified by:
isEnum in interface Value
Overrides:
isEnum in class AbstractValue
Returns:
true when an enum

getValue

public String getValue()
Description copied from interface: EnumValue
Get the value

Specified by:
getValue in interface EnumValue
Returns:
the value

getType

public TypeInfo getType()
Description copied from interface: Value
Get the type of the value

Specified by:
getType in interface Value
Returns:
the type

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class org.jboss.util.JBossObject

calculateHash

protected void calculateHash()
Calculate the hash code



Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.