| Modifier and Type | Field and Description |
|---|---|
| private static final Map | |
| private static final Map | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static Map | |
| private static Map | |
| public static Class | Returns: the class object representing the primitive type, or null if the passed class is not a primitive wrapper.the class object representing a wrapper for a
primitive type. wrapperType)When passed a class representing a wrapper for a primitive type, returns the class representing the corresponding primitive type. |
| public static Class | Returns: the class representing the primitive type, or null if the name does not correspond to a primitive type.the name of the primitive type name)Given a name of a primitive type returns the class representing it. |
| public static Class | Returns: the class object representing the wrapper type, or null if the passed class is not a primitive.the class object representing a primitive type primitiveType)When passed a class representing a primitive type, returns the class representing the corresponding wrapper type. |
| private static <K, V> Map | |
| private static boolean | |
| public static boolean | Returns: true if lossless conversion is possiblethe source type sourceType, final Class<?> the target type targetType)Determines whether a type can be converted to another without losing any precision. |
| public static boolean | Returns: true if source type is method invocation convertible to target type.the type being converted from (call site type for parameter types, method type for return types) sourceType, final Class<?> the parameter type being converted to (method type for parameter types, call site type for return types) targetType)Determines whether one type can be converted to another type using a method invocation conversion, as per JLS 5.3 "Method Invocation Conversion". |
| private static boolean | Returns: true if subType is a proper (not identical to) primitive subtype of the superType that can be represented by the supertype without no precision loss.the supposed subtype subType, final Class<?> the supposed supertype superType)Similar to |
| private static boolean | Returns: true if subType is a proper (not identical to) primitive subtype of the superTypethe supposed subtype subType, final Class<?> the supposed supertype superType)Returns true if a supposed primitive subtype is a proper subtype ( meaning, subtype and not identical) of the supposed primitive supertype |
| public static boolean | Returns: true if subType can be converted by identity conversion, widening primitive conversion, or widening reference conversion to superType.the supposed subtype subType, final Class<?> the supposed supertype of the subtype superType)Determines whether one type is a subtype of another type, as per JLS 4.10 "Subtyping". |
| public static boolean | Returns: true if the passed type is a wrapper for a primitive type.the examined type type)Returns true if the passed type is a wrapper for a primitive type. |
| PRIMITIVE_TYPES | back to summary |
|---|---|
| private static final Map<Class<?>, Class<?>> PRIMITIVE_TYPES | |
| PRIMITIVE_TYPES_BY_NAME | back to summary |
|---|---|
| private static final Map<String, Class<?>> PRIMITIVE_TYPES_BY_NAME | |
| WRAPPER_TYPES | back to summary |
|---|---|
| private static final Map<Class<?>, Class<?>> WRAPPER_TYPES | |
| TypeUtilities | back to summary |
|---|---|
| private TypeUtilities() | |
| createClassNameMapping | back to summary |
|---|---|
| private static Map | |
| createWrapperTypes | back to summary |
|---|---|
| private static Map | |
| getPrimitiveType | back to summary |
|---|---|
| public static Class When passed a class representing a wrapper for a primitive type, returns
the class representing the corresponding primitive type. I.e. calling it
with | |
| getPrimitiveTypeByName | back to summary |
|---|---|
| public static Class Given a name of a primitive type returns the class representing it. I.e.
when invoked with "int", returns | |
| getWrapperType | back to summary |
|---|---|
| public static Class When passed a class representing a primitive type, returns the class representing the corresponding
wrapper type. I.e. calling it with | |
| invertMap | back to summary |
|---|---|
| private static <K, V> Map | |
| isBoxingAndWideningReferenceConversion | back to summary |
|---|---|
| private static boolean isBoxingAndWideningReferenceConversion(final Class<?> sourceType, final Class<?> targetType) | |
| isConvertibleWithoutLoss | back to summary |
|---|---|
| public static boolean isConvertibleWithoutLoss(final Class<?> sourceType, final Class<?> targetType) Determines whether a type can be converted to another without losing any
precision. As a special case, void is considered convertible only to void
and | |
| isMethodInvocationConvertible | back to summary |
|---|---|
| public static boolean isMethodInvocationConvertible(final Class<?> sourceType, final Class<?> targetType) Determines whether one type can be converted to another type using a method invocation conversion, as per JLS 5.3
"Method Invocation Conversion". This is basically all conversions allowed by subtyping (see
| |
| isProperPrimitiveLosslessSubtype | back to summary |
|---|---|
| private static boolean isProperPrimitiveLosslessSubtype(final Class<?> subType, final Class<?> superType) Similar to | |
| isProperPrimitiveSubtype | back to summary |
|---|---|
| private static boolean isProperPrimitiveSubtype(final Class<?> subType, final Class<?> superType) Returns true if a supposed primitive subtype is a proper subtype ( meaning, subtype and not identical) of the supposed primitive supertype | |
| isSubtype | back to summary |
|---|---|
| public static boolean isSubtype(final Class<?> subType, final Class<?> superType) Determines whether one type is a subtype of another type, as per JLS 4.10 "Subtyping". Note this is not strict or proper subtype, therefore true is also returned for identical types; to be completely precise, it allows identity conversion (JLS 5.1.1), widening primitive conversion (JLS 5.1.2) and widening reference conversion (JLS 5.1.5). | |
| isWrapperType | back to summary |
|---|---|
| public static boolean isWrapperType(final Class<?> type) Returns true if the passed type is a wrapper for a primitive type.
| |