Class PrimitiveWrapper
java.lang.Object
org.powermock.reflect.internal.primitivesupport.PrimitiveWrapper
The purpose of the Primitive Wrapper is to provide methods that deals with
translating wrapper types to its related primitive type.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?> getPrimitiveFromWrapperType(Class<?> wrapperType) Get the primitive counter part from a wrapped type.static booleanhasPrimitiveCounterPart(Class<?> type) Returnstrueiftypehas a primitive counter-part.static Class<?>[]toPrimitiveType(Class<?>[] types) Convert all wrapper types intypesto their primitive counter parts.
-
Field Details
-
primitiveWrapper
-
-
Constructor Details
-
PrimitiveWrapper
public PrimitiveWrapper()
-
-
Method Details
-
toPrimitiveType
-
getPrimitiveFromWrapperType
Get the primitive counter part from a wrapped type. For example:getPrimitiveFromWrapperType(Integer.class)will returnint.class.- Parameters:
wrapperType- The wrapper type to convert to its primitive counter part.- Returns:
- The primitive counter part or
nullif the class did not have a primitive counter part.
-
hasPrimitiveCounterPart
Returnstrueiftypehas a primitive counter-part. E.g. iftypeifIntegerthen this method will returntrue.- Parameters:
type- The type to check whether or not it has a primitive counter-part.- Returns:
trueif this type has a primitive counter-part.
-