org.unitils.objectvalidation.reflect
Class TypeWrapper

java.lang.Object
  extended by org.unitils.objectvalidation.reflect.TypeWrapper
Direct Known Subclasses:
ObjectCreatorTypeWrapper

public class TypeWrapper
extends Object

Author:
Tim Ducheyne

Field Summary
protected  Type wrappedType
           
 
Constructor Summary
TypeWrapper(Type wrappedType)
           
 
Method Summary
 boolean equals(Object value)
           
 String getName()
           
 Class<?> getSingleGenericClass()
           
 Type getSingleGenericType()
           
 Type getWrappedType()
           
 int hashCode()
           
 boolean hasRawType(Type rawType)
           
protected  boolean isAssignable(Type toType, Type fromType)
          Checks whether the given fromType is assignable to the given toType, also taking into account possible auto-boxing.
protected  boolean isAssignableClass(Class<?> toClass, Class<?> fromClass)
           
 boolean isAssignableFrom(Type type)
           
protected  boolean isAssignableParameterizedType(ParameterizedType toType, ParameterizedType fromType)
           
 boolean isAssignableTo(Type type)
           
protected  boolean isAssignableWildcardType(WildcardType toType, Type fromType)
           
 boolean isClassType()
           
 boolean isFinal()
           
 boolean isOfType(Type type)
           
 boolean isParameterizedType()
           
 boolean isPrimitive()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

wrappedType

protected Type wrappedType
Constructor Detail

TypeWrapper

public TypeWrapper(Type wrappedType)
Method Detail

getWrappedType

public Type getWrappedType()

getName

public String getName()

isPrimitive

public boolean isPrimitive()

isClassType

public boolean isClassType()

isParameterizedType

public boolean isParameterizedType()

hasRawType

public boolean hasRawType(Type rawType)

isOfType

public boolean isOfType(Type type)

isAssignableTo

public boolean isAssignableTo(Type type)

isAssignableFrom

public boolean isAssignableFrom(Type type)

getSingleGenericClass

public Class<?> getSingleGenericClass()

getSingleGenericType

public Type getSingleGenericType()

isAssignable

protected boolean isAssignable(Type toType,
                               Type fromType)
Checks whether the given fromType is assignable to the given toType, also taking into account possible auto-boxing.

Parameters:
toType - The to type, not null
fromType - The from type, not null
Returns:
True if assignable

isAssignableClass

protected boolean isAssignableClass(Class<?> toClass,
                                    Class<?> fromClass)

isAssignableParameterizedType

protected boolean isAssignableParameterizedType(ParameterizedType toType,
                                                ParameterizedType fromType)

isAssignableWildcardType

protected boolean isAssignableWildcardType(WildcardType toType,
                                           Type fromType)

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isFinal

public boolean isFinal()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013-2015. All Rights Reserved.