code: public static <T> T convert(Object from, Class<? extends T> to, Params arg) {
          if (from == null) {
              throw new NullPointerException("from");
          }
          if (to == null) {
              throw new NullPointerException("to");
          }
          if (from.getClass() == String.class && to.isArray()) {
              return new ArrayConverter((String) from).getArrayForType(to);
          }
          // get it from the internal cache.
          @SuppressWarnings("unchecked")
          Converter<Object, T> c = co.get(key(from.getClass(), to));
          if (c == null) {
              // service provider lookup
              c = lookupConversionService(from.getClass(), to);
              if (c == null) {
                  throw new ComponentException("No Converter: " + from + " (" + from.getClass() + ") -> " + to);
              }
              co.put(key(from.getClass(), to), c);
          }
          Object param = null;
          if (arg != null) {
              param = arg.get(from.getClass(), to);
          }
          return (T) c.convert(from, param);
      }
docs: Convert a String value into an object of a certain type
  
  @param to the type to convert to
  @param from the value to convert
  @param arg conversion argument (e.g. Date format)
  @return the object of a certain type.