org.xenei.jena.entities.impl
Class TypeChecker

java.lang.Object
  extended by org.xenei.jena.entities.impl.TypeChecker

public class TypeChecker
extends Object

A utility class to verify that an instance of one class can be set with an instance of another.


Constructor Summary
TypeChecker()
           
 
Method Summary
static boolean canBeSetFrom(Class<?> a, Class<?> b)
          True if "a" can be set from "b"
static Class<?> getPrimitiveClass(Class<?> clazz)
          Get the primitive class that is equivalent to clazz.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeChecker

public TypeChecker()
Method Detail

canBeSetFrom

public static boolean canBeSetFrom(Class<?> a,
                                   Class<?> b)
True if "a" can be set from "b"

Parameters:
a -
b -
Returns:
true if an instance of a can be set with an instance of b

getPrimitiveClass

public static Class<?> getPrimitiveClass(Class<?> clazz)
Get the primitive class that is equivalent to clazz. If clazz is a primitive returns clazz. If clazz does not wrap a primitive returns null.

Parameters:
clazz - the class to unwrap.
Returns:
The primitive class or null.


Copyright © 2012 XENEI.com. All Rights Reserved.