Class BoxedWrapper


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

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.Class<?>,​java.lang.Class<?>> boxedWrapper  
    • Constructor Summary

      Constructors 
      Constructor Description
      BoxedWrapper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Class<?> getBoxedFromPrimitiveType​(java.lang.Class<?> primitiveType)
      Get the wrapped counter part from a primitive type.
      static boolean hasBoxedCounterPart​(java.lang.Class<?> type)
      Returns true if type has a primitive counter-part.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • boxedWrapper

        private static final java.util.Map<java.lang.Class<?>,​java.lang.Class<?>> boxedWrapper
    • Constructor Detail

      • BoxedWrapper

        public BoxedWrapper()
    • Method Detail

      • getBoxedFromPrimitiveType

        public static java.lang.Class<?> getBoxedFromPrimitiveType​(java.lang.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​(java.lang.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.