Class ClassUtils


  • public class ClassUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.Class<?>,​java.lang.Class<?>> primitiveWrapperMap
      Maps primitive Classes to their corresponding wrapper Class.
      private static java.util.Map<java.lang.Class<?>,​java.lang.Class<?>> wrapperPrimitiveMap
      Maps wrapper Classes to their corresponding primitive types.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isPrimitiveOrWrapper​(java.lang.Class<?> type)
      Returns whether the given type is a primitive or primitive wrapper (Boolean, Byte, Character, Short, Integer, Long, Double, Float).
      static boolean isPrimitiveWrapper​(java.lang.Class<?> type)
      Returns whether the given type is a primitive wrapper (Boolean, Byte, Character, Short, Integer, Long, Double, Float).
      • Methods inherited from class java.lang.Object

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

      • primitiveWrapperMap

        private static final java.util.Map<java.lang.Class<?>,​java.lang.Class<?>> primitiveWrapperMap
        Maps primitive Classes to their corresponding wrapper Class.
      • wrapperPrimitiveMap

        private static final java.util.Map<java.lang.Class<?>,​java.lang.Class<?>> wrapperPrimitiveMap
        Maps wrapper Classes to their corresponding primitive types.
    • Constructor Detail

      • ClassUtils

        public ClassUtils()
    • Method Detail

      • isPrimitiveOrWrapper

        public static boolean isPrimitiveOrWrapper​(java.lang.Class<?> type)
        Returns whether the given type is a primitive or primitive wrapper (Boolean, Byte, Character, Short, Integer, Long, Double, Float).
        Parameters:
        type - The class to query or null.
        Returns:
        true if the given type is a primitive or primitive wrapper (Boolean, Byte, Character, Short, Integer, Long, Double, Float).
      • isPrimitiveWrapper

        public static boolean isPrimitiveWrapper​(java.lang.Class<?> type)
        Returns whether the given type is a primitive wrapper (Boolean, Byte, Character, Short, Integer, Long, Double, Float).
        Parameters:
        type - The class to query or null.
        Returns:
        true if the given type is a primitive wrapper (Boolean, Byte, Character, Short, Integer, Long, Double, Float).
        Since:
        3.1