[ofbiz-framework] branch trunk updated: Implemented: Added a new IntegerToBigInteger converter(OFBIZ-11985)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Implemented: Added a new IntegerToBigInteger converter(OFBIZ-11985)

grv-2
This is an automated email from the ASF dual-hosted git repository.

grv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a79c6cc  Implemented: Added a new IntegerToBigInteger converter(OFBIZ-11985)
a79c6cc is described below

commit a79c6cc3a4dbb21ce9ede1fafa17679207390051
Author: Girish Vasmatkar <[hidden email]>
AuthorDate: Thu Aug 27 22:14:43 2020 +0530

    Implemented: Added a new IntegerToBigInteger converter(OFBIZ-11985)
---
 .../org/apache/ofbiz/base/conversion/NumberConverters.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java
index 78384d6..994169a 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java
@@ -177,6 +177,17 @@ public class NumberConverters implements ConverterLoader {
         }
     }
 
+    public static class IntegerToBigInteger extends AbstractConverter<Integer, BigInteger> {
+        public IntegerToBigInteger() {
+            super(Integer.class, BigInteger.class);
+        }
+
+        @Override
+        public BigInteger convert(Integer obj) throws ConversionException {
+            return BigInteger.valueOf(obj.intValue());
+        }
+    }
+
     public static class ByteToString extends AbstractNumberToStringConverter<Byte> {
         public ByteToString() {
             super(Byte.class);