Example usage for org.apache.commons.convert Converter convert

List of usage examples for org.apache.commons.convert Converter convert

Introduction

In this page you can find the example usage for org.apache.commons.convert Converter convert.

Prototype

public T convert(S obj) throws ConversionException;

Source Link

Document

Converts obj to T.

Usage

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);
    }
}