javax.rad.type
Class AbstractType<T>

java.lang.Object
  extended by javax.rad.type.AbstractType<T>
Type Parameters:
T - the type.
All Implemented Interfaces:
IType<T>
Direct Known Subclasses:
AbstractBeanType, AbstractComparableType, AbstractDateType, BinaryType, FileHandleType, NullType, UnknownType

public abstract class AbstractType<T>
extends Object
implements IType<T>

The AbstractType is the default implementation of IType.


Field Summary
 
Fields inherited from interface javax.rad.type.IType
UNKNOWN_TYPE
 
Constructor Summary
AbstractType()
           
 
Method Summary
 boolean equals(T pObject1, Object pObject2)
          Returns true, if the two objects are equal.
static IType<?> getTypeFromClass(Class<?> pClass)
          Gets the type for a Class.
static IType<?> getTypeFromObject(Object pObject)
          Gets the type for an Object.
 int hashCode(T pObject)
          Returns the hash code of the given object.
static void registerType(IType<?> pType)
          Registers a type.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.rad.type.IType
compareTo, getTypeClass
 

Constructor Detail

AbstractType

public AbstractType()
Method Detail

valueOf

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

Specified by:
valueOf in interface IType<T>
Parameters:
pObject - the Object to convert
Returns:
the Object which is an instance of type class.

validatedValueOf

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

Specified by:
validatedValueOf in interface IType<T>
Parameters:
pObject - the Object to convert
Returns:
the Object which is an instance of type class.

hashCode

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

Specified by:
hashCode in interface IType<T>
Parameters:
pObject - the object.
Returns:
the hash code.

equals

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

Specified by:
equals in interface IType<T>
Parameters:
pObject1 - the first object.
pObject2 - the second object.
Returns:
true, if the two objects are equal.

toString

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

Specified by:
toString in interface IType<T>
Parameters:
pObject - the object.
Returns:
the String representation of the Object.

registerType

public static void registerType(IType<?> pType)
Registers a type.

Parameters:
pType - the type.

getTypeFromObject

public static IType<?> getTypeFromObject(Object pObject)
Gets the type for an Object.

Parameters:
pObject - the object.
Returns:
the type for the object.

getTypeFromClass

public static IType<?> getTypeFromClass(Class<?> pClass)
Gets the type for a Class.

Parameters:
pClass - the class.
Returns:
the type for the class.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.