/** * Get the converter or throw exception * @param <T> * @param type type to convert to * @return the converter or die * @throws UnsupportedOperationException if the converter cannot be found */ protected <T> Converter<T> getConverterOrFail(Class<T> type) { Converter<T> converter = getConverter(type); if (converter == null) { throw new UnsupportedOperationException("Conversion failure: No converter available to handle conversions to type ("+type+")"); } return converter; }
/** * Get the converter or throw exception * @param <T> * @param type type to convert to * @return the converter or die * @throws UnsupportedOperationException if the converter cannot be found */ protected <T> Converter<T> getConverterOrFail(Class<T> type) { Converter<T> converter = getConverter(type); if (converter == null) { throw new UnsupportedOperationException("Conversion failure: No converter available to handle conversions to type ("+type+")"); } return converter; }
convert = null; } else { Converter<String> converter = getConverter(String.class); return converter.convert(value); Converter<String> converter = getConverter(String.class); return converter.convert(object);
convert = null; } else { Converter<String> converter = getConverter(String.class); return converter.convert(value); Converter<String> converter = getConverter(String.class); return converter.convert(object);