javax.rad.type
Interface IType<T>

Type Parameters:
T - the type.
All Known Implementing Classes:
AbstractBeanType, AbstractComparableType, AbstractNumberType, AbstractType, BeanType, BooleanType, DecimalType, DoubleType, FloatType, IntegerType, LongType, NullType, StringType, UnknownType

public interface IType<T>

The Type is a platform independent definition of standard types.


Field Summary
static UnknownType UNKNOWN_TYPE
          The type is unknown.
 
Method Summary
 int compareTo(T pObject1, Object pObject2)
          Compares two objects.
 boolean equals(T pObject1, Object pObject2)
          Returns true, if the two objects are equal.
 Class<T> getTypeClass()
          Returns the class used by this type.
 int hashCode(T pObject)
          Returns the hash code of the given object.
 String toString(T pObject)
          Converts the object to a String.
 T validatedValueOf(Object pObject)
          Converts the object to an Object which is an instance of type class.
 T valueOf(Object pObject)
          Converts the object to an Object which is an instance of type class.
 

Field Detail

UNKNOWN_TYPE

static final UnknownType UNKNOWN_TYPE
The type is unknown.

Method Detail

getTypeClass

Class<T> getTypeClass()
Returns the class used by this type.

Returns:
the class used by this type.

valueOf

T valueOf(Object pObject)
Converts the object to an Object which is an instance of type class.

Parameters:
pObject - the Object to convert
Returns:
the Object which is an instance of type class.

validatedValueOf

T validatedValueOf(Object pObject)
Converts the object to an Object which is an instance of type class.

Parameters:
pObject - the Object to convert
Returns:
the Object which is an instance of type class.

hashCode

int hashCode(T pObject)
Returns the hash code of the given object.

Parameters:
pObject - the object.
Returns:
the hash code.

equals

boolean equals(T pObject1,
               Object pObject2)
Returns true, if the two objects are equal.

Parameters:
pObject1 - the first object.
pObject2 - the second object.
Returns:
true, if the two objects are equal.

compareTo

int compareTo(T pObject1,
              Object pObject2)
Compares two objects. If the first object is smaller than the second object a value < 0 is returned. If the two objects are equal than 0 is returned. If the first object is greater than the second object a value > 0 is returned.

Parameters:
pObject1 - the first object.
pObject2 - the second object.
Returns:
< 0 if pObject1 is smaller, 0 if equal and > 0 if it is greater then pObject2

toString

String toString(T pObject)
Converts the object to a String.

Parameters:
pObject - the object.
Returns:
the String representation of the Object.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.