public static Object convertValue ( final Object value , final Class < ? > convertType ) { if ( null == value ) { return convertNullValue ( convertType ) ; } if ( value . getClass ( ) == convertType ) { return value ; } if ( value instanceof Number ) { return convertNumberValue ( value , convertType ) ; } if ( value instanceof Date ) { return convertDateValue ( value , convertType ) ; } if ( String . class . equals ( convertType ) ) { return value . toString ( ) ; } else { return value ; } }
Convert value via expected class type .