java.lang.Object
org.powermock.reflect.internal.primitivesupport.BoxedWrapper

public class BoxedWrapper extends Object
The purpose of the Primitive Wrapper is to provide methods that deals with translating wrapper types to its related primitive type.
  • Field Details

    • boxedWrapper

      private static final Map<Class<?>,Class<?>> boxedWrapper
  • Constructor Details

    • BoxedWrapper

      public BoxedWrapper()
  • Method Details

    • getBoxedFromPrimitiveType

      public static Class<?> getBoxedFromPrimitiveType(Class<?> primitiveType)
      Get the wrapped counter part from a primitive type. For example:

      getBoxedFromPrimitiveType(int.class) will return Integer.class.

      Parameters:
      primitiveType - The primitive type to convert to its wrapper counter part.
      Returns:
      The boxed counter part or null if the class did not have a boxed counter part.
    • hasBoxedCounterPart

      public static boolean hasBoxedCounterPart(Class<?> type)
      Returns true if type has a primitive counter-part. E.g. if type if Integer then this method will return true.
      Parameters:
      type - The type to check whether or not it has a primitive counter-part.
      Returns:
      true if this type has a primitive counter-part.