code: private Object writeSimple(Class<?> declaredType, Object value) {
          Class<?> realType = value.getClass();
          if (realType == Integer.class || realType == Long.class || realType == Short.class ||
                  realType == Byte.class || realType == Float.class || realType == Double.class ||
                  realType == Boolean.class) {
              return value;
          } else {
              // write as a string
              try {
                  String converted = settings.getConverter().convertToString(realType, value);
                  if (converted == null) {
                      throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
                  }
                  return converted;
              } catch (RuntimeException ex) {
                  throw new IllegalArgumentException(
                          "Unable to convert type " + declaredType.getName() + " for real type: " + realType.getName(), ex);
              }
          }
      }
docs: write simple type