com.tomgibara.pronto.util
Class Classes

java.lang.Object
  extended by com.tomgibara.pronto.util.Classes

public final class Classes
extends java.lang.Object

Collects together utility methods for handling class objects.

Author:
Tom Gibara

Method Summary
static java.lang.Class classForPrimitive(java.lang.Class clss)
          Identifies the object class which corresponds to a specified primitive class, or throws an exception.
static boolean isBooleanPrimitive(java.lang.Class clss)
          Whether the supplied class represents the boolean primitive.
static boolean isNonVoidPrimitive(java.lang.Class clss)
          Whether the class is strictly primitive - not including the Void.TYPE.
static boolean isNumberPrimitive(java.lang.Class clss)
          Whether the supplied class represents a number primitive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

classForPrimitive

public static java.lang.Class classForPrimitive(java.lang.Class clss)
                                         throws java.lang.IllegalArgumentException
Identifies the object class which corresponds to a specified primitive class, or throws an exception.

Parameters:
clss - the class
Returns:
the object class for the supplied primitive class, never null
Throws:
java.lang.IllegalArgumentException - if the supplied class is null or does not represent a primitive type

isNonVoidPrimitive

public static boolean isNonVoidPrimitive(java.lang.Class clss)
Whether the class is strictly primitive - not including the Void.TYPE.

Parameters:
clss - the class
Returns:
true if and only if the class is primitive and not void

isNumberPrimitive

public static boolean isNumberPrimitive(java.lang.Class clss)
Whether the supplied class represents a number primitive.

Parameters:
clss - the class
Returns:
true if and only if clss equals the TYPE of some extension of Number

isBooleanPrimitive

public static boolean isBooleanPrimitive(java.lang.Class clss)
Whether the supplied class represents the boolean primitive.

Parameters:
clss - the class
Returns:
true if and only if clss == Boolean.TYPE


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.