org.jboss.metatype.api.values
Class SimpleValueSupport

java.lang.Object
  extended by org.jboss.metatype.api.values.AbstractMetaValue
      extended by org.jboss.metatype.api.values.SimpleValueSupport
All Implemented Interfaces:
Serializable, Cloneable, Comparable<SimpleValue>, MetaValue, SimpleValue

public class SimpleValueSupport
extends AbstractMetaValue
implements SimpleValue

SimpleValue.

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

Constructor Summary
SimpleValueSupport(SimpleMetaType metaType, Serializable value)
          Create a new SimpleValueSupport.
 
Method Summary
 int compareTo(SimpleValue sv)
           
 boolean equals(Object obj)
           
 SimpleMetaType getMetaType()
          Get the metatype for this value
 Serializable getValue()
          Get the value.
 int hashCode()
           
 void setValue(Serializable value)
          Set the value.
 String toString()
           
static SimpleValue wrap(boolean value)
           
static SimpleValue wrap(byte value)
           
static SimpleValue wrap(char value)
           
static SimpleValue wrap(double value)
           
static SimpleValue wrap(float value)
           
static SimpleValue wrap(int value)
           
static SimpleValue wrap(long value)
           
static SimpleValue wrap(Serializable object)
          Wrap a simple object in simple value
static SimpleValue wrap(short value)
           
 
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

SimpleValueSupport

public SimpleValueSupport(SimpleMetaType metaType,
                          Serializable value)
Create a new SimpleValueSupport.

Parameters:
metaType - the simple meta type
value - the value
Throws:
IllegalArgumentException - for a null simpleMetaType
Method Detail

wrap

public static SimpleValue wrap(Serializable object)
Wrap a simple object in simple value

Parameters:
object - the simple object
Returns:
the simple value

wrap

public static SimpleValue wrap(boolean value)

wrap

public static SimpleValue wrap(byte value)

wrap

public static SimpleValue wrap(char value)

wrap

public static SimpleValue wrap(short value)

wrap

public static SimpleValue wrap(int value)

wrap

public static SimpleValue wrap(long value)

wrap

public static SimpleValue wrap(float value)

wrap

public static SimpleValue wrap(double value)

getMetaType

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

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

getValue

public Serializable getValue()
Get the value.

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

setValue

public void setValue(Serializable 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

compareTo

public int compareTo(SimpleValue sv)
Specified by:
compareTo in interface Comparable<SimpleValue>


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