summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/asn1/datatypes/Asn1BigInteger.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-03-29 14:44:43 +0200
committerGitHub <noreply@github.com>2021-03-29 14:44:43 +0200
commitc25be270079ed4fa23d7a5c2a2d5eb8519243fb3 (patch)
tree011863c021df3e5356f07b056d30d0e7476061e4 /src/main/java/org/uic/barcode/asn1/datatypes/Asn1BigInteger.java
parentMerge pull request #13 from UnionInternationalCheminsdeFer/time_zone_fix_3 (diff)
parentstructure change 1 (diff)
downloadUIC-barcode-c25be270079ed4fa23d7a5c2a2d5eb8519243fb3.tar
UIC-barcode-c25be270079ed4fa23d7a5c2a2d5eb8519243fb3.tar.gz
UIC-barcode-c25be270079ed4fa23d7a5c2a2d5eb8519243fb3.tar.bz2
UIC-barcode-c25be270079ed4fa23d7a5c2a2d5eb8519243fb3.tar.lz
UIC-barcode-c25be270079ed4fa23d7a5c2a2d5eb8519243fb3.tar.xz
UIC-barcode-c25be270079ed4fa23d7a5c2a2d5eb8519243fb3.tar.zst
UIC-barcode-c25be270079ed4fa23d7a5c2a2d5eb8519243fb3.zip
Diffstat (limited to 'src/main/java/org/uic/barcode/asn1/datatypes/Asn1BigInteger.java')
-rw-r--r--src/main/java/org/uic/barcode/asn1/datatypes/Asn1BigInteger.java72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/asn1/datatypes/Asn1BigInteger.java b/src/main/java/org/uic/barcode/asn1/datatypes/Asn1BigInteger.java
new file mode 100644
index 0000000..4adca22
--- /dev/null
+++ b/src/main/java/org/uic/barcode/asn1/datatypes/Asn1BigInteger.java
@@ -0,0 +1,72 @@
+package org.uic.barcode.asn1.datatypes;
+
+import java.math.BigInteger;
+
+//outdated: use BigInteger
+public class Asn1BigInteger {
+
+ private final BigInteger value;
+
+ public Asn1BigInteger(final BigInteger value) {
+ this.value = value;
+ }
+
+ @Override public String toString() {
+ return "" + value;
+ }
+
+ public BigInteger value() { return value; }
+
+ public Long longValue() {
+ return value.longValue();
+ }
+
+ public Integer intValue() {
+ return value.intValue();
+ }
+
+ public Asn1BigInteger(Long num) {
+ this.value = BigInteger.valueOf(num);
+ }
+
+ public Asn1BigInteger(long num) {
+ this.value = BigInteger.valueOf(num);
+ }
+
+ public Asn1BigInteger(Integer num) {
+ this.value = BigInteger.valueOf(num);
+ }
+
+ public Asn1BigInteger(int num) {
+ this.value = BigInteger.valueOf(num);
+ }
+
+ public static Long toLong(Asn1BigInteger object) {
+ if (object == null) return null;
+ return object.longValue();
+ }
+
+ public static Asn1BigInteger toAsn1(Long object) {
+ if (object == null) return null;
+ return new Asn1BigInteger(object);
+ }
+
+ public static Asn1BigInteger toAsn1(Integer object) {
+ if (object == null) return null;
+ return new Asn1BigInteger(object);
+ }
+
+ public Long toLong(){
+ if (this.value != null) {
+ return this.value.longValue();
+ }
+ return null;
+ }
+
+ public BigInteger toBigInteger(){
+ return value;
+ }
+
+
+
+}