List of usage examples for org.apache.commons.convert Converter convert
public T convert(S obj) throws ConversionException;
obj to T. From source file:mil.army.usace.data.dataquery.utility.ConversionUtility.java
public static <S> Object convertType(S source, Class target) throws ClassNotFoundException, ConversionException { if (source == null) return null; else {//from ww w .j av a 2 s.c o m Converter<S, ?> converter = (Converter<S, ?>) Converters.getConverter(source.getClass(), target); return converter.convert(source); } }
From source file:mil.army.usace.data.dataquery.utility.DefaultConverter.java
public <S> Object convertType(S source, Class target) throws ClassNotFoundException, ConversionException { if (source == null) return null; else {/* w ww . j a v a 2 s .co m*/ Converter<S, ?> converter = (Converter<S, ?>) Converters.getConverter(source.getClass(), target); return converter.convert(source); } }
From source file:mil.army.usace.data.nativequery.rdbms.NativeRdbmsQuery.java
protected <S> Object convertType(S source, Class target) throws Exception { if (source == null) return null; else {/*from www . j a v a 2 s. c o m*/ Converter<S, ?> converter = (Converter<S, ?>) Converters.getConverter(source.getClass(), target); return converter.convert(source); } }