Package com.jidesoft.utils
Class TypeUtils
java.lang.Object
com.jidesoft.utils.TypeUtils
Utils methods for data type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?> convertPrimitiveToWrapperType(Class<?> primitive) static Class<?> convertWrapperToPrimitiveType(Class<?> wrapperType) static booleanisBigDecimalType(Class<?> type) Checks if the type is a BigDecimal type.static booleanisBooleanType(Class<?> type) Checks if the type is a boolean type.static booleanisIntegerType(Class<?> type) Checks if the type is an integer type.static booleanisLongType(Class<?> type) Checks if the type is a long type.static booleanisNumericType(Class<?> type) Checks if the type is a numeric type.static booleanisPrimitive(Class<?> primitive) static booleanisPrimitiveWrapper(Class<?> wrapperType) static booleanisStringType(Class<?> type) Checks if the type is a string type.static booleanisTemporalType(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 booleanisVisualType(Class<?> type) Checks if the type is a type that can be visualized such as color, image or icon.
-
Constructor Details
-
TypeUtils
public TypeUtils()
-
-
Method Details
-
isPrimitive
-
isPrimitiveWrapper
-
convertPrimitiveToWrapperType
-
convertWrapperToPrimitiveType
-
isNumericType
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
Checks if the type is an integer type.- Parameters:
type- the data type.- Returns:
- true if it is numeric type including all subclasses of Integer or int.
-
isLongType
Checks if the type is a long type.- Parameters:
type- the data type.- Returns:
- true if it is numeric type including all subclasses of Long or long.
-
isBigDecimalType
Checks if the type is a BigDecimal type.- Parameters:
type- the data type.- Returns:
- true if it is numeric type including all subclasses of BigDecimal.
-
isStringType
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
Checks if the type is a boolean type.- Parameters:
type- the data type.- Returns:
- true if it is a boolean
-
isTemporalType
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
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.
-