Package org.atlanmod.commons.primitive
Class Primitives
- java.lang.Object
-
- org.atlanmod.commons.primitive.Primitives
-
public final class Primitives extends Object
Static utility methods related to Java primitive types.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisBoxed(Class<?> type)Returnstrueif thetypeis a boxed Java primitive type.static booleanisPrimitive(Class<?> type)Returnstrueif thetypeis a Java primitive type.static booleanisPrimitiveOrString(Class<?> type)Returnstrueif thetypeis considered as a Java primitive type, or its boxed equivalent, or aStringtype.
-
-
-
Method Detail
-
isPrimitiveOrString
public static boolean isPrimitiveOrString(Class<?> type)
Returnstrueif thetypeis considered as a Java primitive type, or its boxed equivalent, or aStringtype.- Parameters:
type- the type to check- Returns:
trueif thetypeis considered as a primitive type.
-
isBoxed
public static boolean isBoxed(Class<?> type)
Returnstrueif thetypeis a boxed Java primitive type.- Parameters:
type- the type to check- Returns:
trueif thetypeis a boxed Java primitive type
-
isPrimitive
public static boolean isPrimitive(Class<?> type)
Returnstrueif thetypeis a Java primitive type.- Parameters:
type- the type to check- Returns:
trueif thetypeis a Java primitive type
-
-