public class PrimitiveTypes
extends java.lang.Object
Constructor and Description |
---|
PrimitiveTypes() |
Modifier and Type | Method and Description |
---|---|
static java.util.stream.Stream<java.lang.Class<?>> |
getPrimitives()
Get all primitive type classes
|
static boolean |
isPrimitive(java.lang.reflect.Type type)
Is the given type a primitive type as per the Java type system.
|
static boolean |
isPrimitiveWrapper(java.lang.reflect.Type type)
Is the type a wrapper for a primitive type as per the Java type system.
|
static <T extends java.lang.reflect.Type> |
unwrapPrimitive(T type)
If this TypeToken is a wrapper of a primitive type, determine the unwrapped
primitive type.
|
static <T extends java.lang.reflect.Type> |
wrapPrimitive(T type)
If this TypeToken is a primitive type, determine the wrapped primitive type.
|
public static java.util.stream.Stream<java.lang.Class<?>> getPrimitives()
public static boolean isPrimitive(java.lang.reflect.Type type)
type
- The type we wish to classify.public static boolean isPrimitiveWrapper(java.lang.reflect.Type type)
type
- The type we wish to classify.public static <T extends java.lang.reflect.Type> T wrapPrimitive(T type)
T
- The type we wish to wrap.type
- The type we wish to wrap.public static <T extends java.lang.reflect.Type> T unwrapPrimitive(T type)
T
- The type we wish to unwrap.type
- The type we wish to unwrap.