code: public static void writePrimitiveValue(Object primitiveValue, JsonGenerator jsonGenerator) throws IOException {
  
          Class<?> primitiveClass = PrimitiveUtil.wrap(primitiveValue.getClass());
          if (String.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeString(String.valueOf(primitiveValue));
          } else if (Byte.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeObject(primitiveValue);
          } else if (Short.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeNumber((short) primitiveValue);
          } else if (Integer.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeNumber((int) primitiveValue);
          } else if (Float.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeNumber((float) primitiveValue);
          } else if (Double.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeNumber((double) primitiveValue);
          } else if (Long.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeNumber((long) primitiveValue);
          } else if (Boolean.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeBoolean((boolean) primitiveValue);
          } else if (UUID.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeString(primitiveValue.toString());
          } else if (BigDecimal.class.isAssignableFrom(primitiveClass)) {
              jsonGenerator.writeNumber((BigDecimal) primitiveValue);
          } else {
              jsonGenerator.writeObject(primitiveValue.toString());
          }
      }
docs: Write the given primitive value to the JSON stream by using the given JSON generator.
  
  @param primitiveValue The given primitive value to write.
  @param jsonGenerator  The given JSON generator.
  @throws IOException If unable to write to the json output stream