velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1770545 - /velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java
Date Sun, 20 Nov 2016 10:17:17 GMT
Author: cbrisson
Date: Sun Nov 20 10:17:17 2016
New Revision: 1770545

URL: http://svn.apache.org/viewvc?rev=1770545&view=rev
Log:
[tools] deprecate MathTool number parsing (redundant with NumberTool numbers formatting tool)

Modified:
    velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java

Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java?rev=1770545&r1=1770544&r2=1770545&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java
(original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java
Sun Nov 20 10:17:17 2016
@@ -581,7 +581,9 @@ public class MathTool extends FormatConf
      * @param num the number to be converted
      * @return a {@link Integer} representation of the number
      *         or <code>null</code> if it's invalid
+     * @deprecated use {@link NumberTool#toNumber(Object)}.intValue()
      */
+    @Deprecated
     public Integer toInteger(Object num)
     {
         Number n = toNumber(num);
@@ -600,7 +602,9 @@ public class MathTool extends FormatConf
      * @param num the number to be converted
      * @return a {@link Long} integer representation of the number
      *         or <code>null</code> if it's invalid
+     * @deprecated use {@link NumberTool#toNumber(Object)}.longValue()
      */
+    @Deprecated
     public Long toLong(Object num)
     {
         Number n = toNumber(num);
@@ -619,7 +623,9 @@ public class MathTool extends FormatConf
      * @param num the number to be converted
      * @return a {@link Double} representation of the number
      *         or <code>null</code> if it's invalid
+     * @deprecated use {@link NumberTool#toNumber(Object)}.doubleValue()
      */
+    @Deprecated
     public Double toDouble(Object num)
     {
         Number n = toNumber(num);
@@ -633,7 +639,7 @@ public class MathTool extends FormatConf
 
     /**
      * Converts an object with a numeric value into a Number
-     * Valid formats are {@link Number} or a {@link String}
+      Valid formats are {@link Number} or a {@link String}
      * representation of a number.  Note that this does not
      * handle localized number formats.  Use the {@link NumberTool}
      * to handle such conversions.
@@ -641,7 +647,9 @@ public class MathTool extends FormatConf
      * @param num the number to be converted
      * @return a {@link Number} representation of the number
      *         or <code>null</code> if it's invalid
+     * @deprecated use {@link NumberTool#toNumber(Object)}
      */
+    @Deprecated
     public Number toNumber(Object num)
     {
         return ConversionUtils.toNumber(num, getFormat(), getLocale());



Mime
View raw message