@SuppressWarnings("unchecked")
	public static <T> T convertToType(Class<T> type, String value) {
		if (type == String.class) {
			return (T) String.valueOf(value);
		} else if (isNumber(type))
			return (T) getNumber((Class<? extends Number>) type, value);
		else if (type == Boolean.class || type == boolean.class) {
			return (T) Boolean.valueOf(value);
		} else if ((type == char.class || Character.class == type)
				&& (value != null && !value.isEmpty())) {
			return (T) Character.valueOf(value.charAt(0));
		} else {
			return null;
		}
	}