code: public static Object convertValue(final Object value, final Class<?> convertType) {
          if (null == value) {
              return convertNullValue(convertType);
          } 
          if (value.getClass() == convertType) {
              return value;
          }
          if (value instanceof Number) {
              return convertNumberValue(value, convertType);
          }
          if (value instanceof Date) {
              return convertDateValue(value, convertType);
          }
          if (String.class.equals(convertType)) {
              return value.toString();
          } else {
              return value;
          }
      }
docs: Convert value via expected class type.
  
  @param value original value
  @param convertType expected class type
  @return converted value