public static boolean isPrimitive ( Object value ) { if ( value == null ) { return true ; } else if ( value . getClass ( ) . isPrimitive ( ) == true ) { return true ; } else if ( Integer . class . isInstance ( value ) ) { return true ; } else if ( Long . class . isInstance ( value ) ) { return true ; } else if ( Double . class . isInstance ( value ) ) { return true ; } else if ( Float . class . isInstance ( value ) ) { return true ; } else if ( Short . class . isInstance ( value ) ) { return true ; } else if ( Byte . class . isInstance ( value ) ) { return true ; } else if ( Character . class . isInstance ( value ) ) { return true ; } else if ( Boolean . class . isInstance ( value ) ) { return true ; } else if ( BigDecimal . class . isInstance ( value ) ) { return true ; } else if ( BigInteger . class . isInstance ( value ) ) { return true ; } return false ; }
Checks is value is of Primitive type