commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kris Nuttycombe" <Kris.Nuttyco...@noaa.gov>
Subject [beanutils] Generifying the Converter interface
Date Thu, 14 Oct 2004 19:15:56 GMT
I'm just starting to play around with generics, and thought that 
org.apache.commons.beanutils.Converter might be an interesting candidate 
for generification. A good generified converter library is broadly 
useful outside of BeanUtils.

Here's my first thought on generifying the Converter interface:

public interface Converter<I,O>{
    /**
     * Convert the specified input object into an output object of the
     * specified type.
     *
     * @param type Data type to which this value should be converted
     * @param value The input value to be converted
     *
     * @exception ConversionException if conversion cannot be performed
     *  successfully
     */
    public O convert(Class<O> type, I value);
}

Comments, suggestions?

Kris

-- 
=====================================================
Kris Nuttycombe
Associate Scientist
Geospatial Data Services Group
CIRES, National Geophysical Data Center/NOAA
(303) 497-6337
Kris.Nuttycombe@noaa.gov
=====================================================



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message