com.jidesoft.utils
Class TypeUtils

java.lang.Object
  extended by com.jidesoft.utils.TypeUtils

public class TypeUtils
extends Object

Utils methods for data type.


Constructor Summary
TypeUtils()
           
 
Method Summary
static Class<?> convertPrimitiveToWrapperType(Class<?> primitive)
           
static Class<?> convertWrapperToPrimitiveType(Class<?> wrapperType)
           
static boolean isBooleanType(Class<?> type)
          Checks if the type is a boolean type.
static boolean isIntegerType(Class<?> type)
          Checks if the type is a numeric type.
static boolean isNumericType(Class<?> type)
          Checks if the type is a numeric type.
static boolean isPrimitive(Class<?> primitive)
           
static boolean isPrimitiveWrapper(Class<?> wrapperType)
           
static boolean isStringType(Class<?> type)
          Checks if the type is a string type.
static boolean isTemporalType(Class<?> type)
          Checks if the type is a temporal type such as Date, Calendar, long or double that can be used to represent date or time.
static boolean isVisualType(Class<?> type)
          Checks if the type is a type that can be visualized such as color, image or icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeUtils

public TypeUtils()
Method Detail

isPrimitive

public static boolean isPrimitive(Class<?> primitive)

isPrimitiveWrapper

public static boolean isPrimitiveWrapper(Class<?> wrapperType)

convertPrimitiveToWrapperType

public static Class<?> convertPrimitiveToWrapperType(Class<?> primitive)

convertWrapperToPrimitiveType

public static Class<?> convertWrapperToPrimitiveType(Class<?> wrapperType)

isNumericType

public static boolean isNumericType(Class<?> type)
Checks if the type is a numeric type.

Parameters:
type - the data type.
Returns:
true if it is numeric type including all subclasses of Number, double, int, float, short and long.

isIntegerType

public static boolean isIntegerType(Class<?> type)
Checks if the type is a numeric type.

Parameters:
type - the data type.
Returns:
true if it is numeric type including all subclasses of Integer or int.

isStringType

public static boolean isStringType(Class<?> type)
Checks if the type is a string type.

Parameters:
type - the data type.
Returns:
true if it is numeric type including all subclasses of String.

isBooleanType

public static boolean isBooleanType(Class<?> type)
Checks if the type is a boolean type.

Parameters:
type - the data type.
Returns:
true if it is a boolean

isTemporalType

public static boolean isTemporalType(Class<?> type)
Checks if the type is a temporal type such as Date, Calendar, long or double that can be used to represent date or time.

Parameters:
type - the data type.
Returns:
true if it is temporal type including all subclasses.

isVisualType

public static boolean isVisualType(Class<?> type)
Checks if the type is a type that can be visualized such as color, image or icon.

Parameters:
type - the data type.
Returns:
true if it is visual type including all subclasses.


Copyright © 2014. All rights reserved.