org.jboss.metatype.api.values
Class EnumValueSupport

java.lang.Object
  extended by org.jboss.metatype.api.values.AbstractMetaValue
      extended by org.jboss.metatype.api.values.EnumValueSupport
All Implemented Interfaces:
Serializable, Cloneable, EnumValue, MetaValue

public class EnumValueSupport
extends AbstractMetaValue
implements EnumValue

EnumValue. TODO tests

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Constructor Summary
EnumValueSupport(EnumMetaType metaType, Enum<?> value)
          Create a new EnumValueSupport from an Enum value.
EnumValueSupport(EnumMetaType metaType, String value)
          Create a new EnumValueSupport.
 
Method Summary
 boolean equals(Object obj)
           
 EnumMetaType getMetaType()
          Get the metatype for this value
 String getValue()
          Get the value.
 int hashCode()
           
 void setValue(String value)
          Set the value.
 String toString()
           
 
Methods inherited from class org.jboss.metatype.api.values.AbstractMetaValue
clone
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.metatype.api.values.MetaValue
clone
 

Constructor Detail

EnumValueSupport

public EnumValueSupport(EnumMetaType metaType,
                        String value)
Create a new EnumValueSupport.

Parameters:
metaType - the enum meta type
value - the value
Throws:
IllegalArgumentException - for a null enum MetaType

EnumValueSupport

public EnumValueSupport(EnumMetaType metaType,
                        Enum<?> value)
Create a new EnumValueSupport from an Enum value.

Parameters:
metaType - the enum meta type
value - the enum instance
Throws:
IllegalArgumentException - for a null enum MetaType
Method Detail

getMetaType

public EnumMetaType getMetaType()
Description copied from interface: MetaValue
Get the metatype for this value

Specified by:
getMetaType in interface EnumValue
Specified by:
getMetaType in interface MetaValue
Returns:
the metatype

getValue

public String getValue()
Get the value.

Specified by:
getValue in interface EnumValue
Returns:
the value.

setValue

public void setValue(String value)
Set the value.

Parameters:
value - the value.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


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