/** * Converts the given value to class c. * * @param type * Class to get the converter for. * * @return The converter for the given type * * @see org.apache.wicket.util.convert.IConverter#convertToObject(String, java.util.Locale) */ @Override public final <C> IConverter<C> getConverter(Class<C> type) { // Null is always converted to null if (type == null) { @SuppressWarnings("unchecked") IConverter<C> converter = (IConverter<C>)new DefaultConverter<String>(String.class); return converter; } // Get type converter for class final IConverter<C> converter = get(type); if (converter == null) { return new DefaultConverter<>(type); } return converter; }
/** * Converts the given value to class c. * * @param type * Class to get the converter for. * * @return The converter for the given type * * @see org.apache.wicket.util.convert.IConverter#convertToObject(String, java.util.Locale) */ @Override public final <C> IConverter<C> getConverter(Class<C> type) { // Null is always converted to null if (type == null) { @SuppressWarnings("unchecked") IConverter<C> converter = (IConverter<C>)new DefaultConverter<String>(String.class); return converter; } // Get type converter for class final IConverter<C> converter = get(type); if (converter == null) { return new DefaultConverter<>(type); } return converter; }