commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1537264 - /commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/locale/LocaleConverter.java
Date Wed, 30 Oct 2013 20:15:33 GMT
Author: oheger
Date: Wed Oct 30 20:15:33 2013
New Revision: 1537264

URL: http://svn.apache.org/r1537264
Log:
Generified LocaleConverter.

Analoguously to the Converter interface, there is now a type parameter for the
desired target type of a conversion. This also implies that all converter
implementations have to check a result value whether it conforms to the target
type.

Modified:
    commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/locale/LocaleConverter.java

Modified: commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/locale/LocaleConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/locale/LocaleConverter.java?rev=1537264&r1=1537263&r2=1537264&view=diff
==============================================================================
--- commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/locale/LocaleConverter.java
(original)
+++ commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/locale/LocaleConverter.java
Wed Oct 30 20:15:33 2013
@@ -35,13 +35,14 @@ public interface LocaleConverter extends
      * Convert the specified locale-sensitive input object into an output object of the
      * specified type.
      *
+     * @param <T> The desired target type of the conversion
      * @param type Data type to which this value should be converted
      * @param value The input value to be converted
      * @param pattern The user-defined pattern is used for the input object formatting.
      * @return The converted value
      *
      * @exception org.apache.commons.beanutils.ConversionException if conversion
-     * cannot be performed successfully
+     * cannot be performed successfully or if the target type is not supported
      */
-    public Object convert(Class type, Object value, String pattern);
+    public <T> T convert(Class<T> type, Object value, String pattern);
 }



Mime
View raw message