Update auto-generated Java bindings (all functionally equivalent)
[ldk-java] / src / main / java / org / ldk / structs / Result_NoneErrorZ.java
index 158ece2f33ed199fee01a9933d8bebccc59eb7b8..fcc1c2a540e879aad53436b51e38f96641618443 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import java.lang.ref.Reference;
 import javax.annotation.Nullable;
 
 public class Result_NoneErrorZ extends CommonBase {
@@ -13,7 +14,7 @@ public class Result_NoneErrorZ extends CommonBase {
        }
 
        static Result_NoneErrorZ constr_from_ptr(long ptr) {
-               if (bindings.LDKCResult_NoneErrorZ_result_ok(ptr)) {
+               if (bindings.CResult_NoneErrorZ_is_ok(ptr)) {
                        return new Result_NoneErrorZ_OK(null, ptr);
                } else {
                        return new Result_NoneErrorZ_Err(null, ptr);
@@ -29,7 +30,7 @@ public class Result_NoneErrorZ extends CommonBase {
                public final IOError err;
                private Result_NoneErrorZ_Err(Object _dummy, long ptr) {
                        super(_dummy, ptr);
-                       this.err = bindings.LDKCResult_NoneErrorZ_get_err(ptr);
+                       this.err = bindings.CResult_NoneErrorZ_get_err(ptr);
                }
        }
 
@@ -38,7 +39,7 @@ public class Result_NoneErrorZ extends CommonBase {
         */
        public static Result_NoneErrorZ ok() {
                long ret = bindings.CResult_NoneErrorZ_ok();
-               if (ret >= 0 && ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -48,18 +49,35 @@ public class Result_NoneErrorZ extends CommonBase {
         */
        public static Result_NoneErrorZ err(org.ldk.enums.IOError e) {
                long ret = bindings.CResult_NoneErrorZ_err(e);
-               if (ret >= 0 && ret < 1024) { return null; }
+               Reference.reachabilityFence(e);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if the given object is currently in the success state
+        */
+       public boolean is_ok() {
+               boolean ret = bindings.CResult_NoneErrorZ_is_ok(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       long clone_ptr() {
+               long ret = bindings.CResult_NoneErrorZ_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Creates a new CResult_NoneErrorZ which has the same data as `orig`
         * but with all dynamically-allocated buffers duplicated in new buffers.
         */
        public Result_NoneErrorZ clone() {
                long ret = bindings.CResult_NoneErrorZ_clone(this.ptr);
-               if (ret >= 0 && ret < 1024) { return null; }
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }