code: public static <T> T cast(Object value, Class<T> type) {
          if (null == value) {
              return null;
          }
          if (!type.isAssignableFrom(value.getClass())) {
              if (is(type, int.class, Integer.class)) {
                  value = Integer.parseInt(value.toString());
              } else if (is(type, long.class, Long.class)) {
                  value = Long.parseLong(value.toString());
              } else if (is(type, float.class, Float.class)) {
                  value = Float.parseFloat(value.toString());
              } else if (is(type, double.class, Double.class)) {
                  value = Double.parseDouble(value.toString());
              } else if (is(type, boolean.class, Boolean.class)) {
                  value = Boolean.parseBoolean(value.toString());
              } else if (is(type, String.class)) {
                  value = value.toString();
              }
          }
          return (T) value;
      }
docs: Converts value to a specified type
  
  @param value instance value
  @param type  target type
  @param <T>   target type
  @return converted value