[Java] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / src / main / java / org / ldk / structs / Result_ShutdownScriptDecodeErrorZ.java
index 5bf4fcb6b0f2716f28e348fe905a522d6f9b8245..45ca00593593ba0d97ab7d1e5a5f8ad95a18121f 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_ShutdownScriptDecodeErrorZ extends CommonBase {
@@ -12,6 +13,10 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase {
                if (ptr != 0) { bindings.CResult_ShutdownScriptDecodeErrorZ_free(ptr); } super.finalize();
        }
 
+       protected void force_free() {
+               if (ptr != 0) { bindings.CResult_ShutdownScriptDecodeErrorZ_free(ptr); ptr = 0; }
+       }
+
        static Result_ShutdownScriptDecodeErrorZ constr_from_ptr(long ptr) {
                if (bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(ptr)) {
                        return new Result_ShutdownScriptDecodeErrorZ_OK(null, ptr);
@@ -23,9 +28,9 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase {
                public final ShutdownScript res;
                private Result_ShutdownScriptDecodeErrorZ_OK(Object _dummy, long ptr) {
                        super(_dummy, ptr);
-                       long res = bindings.LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(ptr);
-                       ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ShutdownScript(null, res); }
-                       res_hu_conv.ptrs_to.add(this);
+                       long res = bindings.CResult_ShutdownScriptDecodeErrorZ_get_ok(ptr);
+                       org.ldk.structs.ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ShutdownScript(null, res); }
+                       if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); };
                        this.res = res_hu_conv;
                }
        }
@@ -34,9 +39,9 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase {
                public final DecodeError err;
                private Result_ShutdownScriptDecodeErrorZ_Err(Object _dummy, long ptr) {
                        super(_dummy, ptr);
-                       long err = bindings.LDKCResult_ShutdownScriptDecodeErrorZ_get_err(ptr);
-                       DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); }
-                       err_hu_conv.ptrs_to.add(this);
+                       long err = bindings.CResult_ShutdownScriptDecodeErrorZ_get_err(ptr);
+                       org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
+                       if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
                        this.err = err_hu_conv;
                }
        }
@@ -44,20 +49,24 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase {
        /**
         * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
         */
-       public static Result_ShutdownScriptDecodeErrorZ ok(ShutdownScript o) {
-               long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+       public static Result_ShutdownScriptDecodeErrorZ ok(org.ldk.structs.ShutdownScript o) {
+               long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o.ptr);
+               Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); };
                return ret_hu_conv;
        }
 
        /**
         * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
         */
-       public static Result_ShutdownScriptDecodeErrorZ err(DecodeError e) {
-               long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+       public static Result_ShutdownScriptDecodeErrorZ err(org.ldk.structs.DecodeError e) {
+               long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_err(e.ptr);
+               Reference.reachabilityFence(e);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
                return ret_hu_conv;
        }
 
@@ -66,11 +75,13 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase {
         */
        public boolean is_ok() {
                boolean ret = bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
        long clone_ptr() {
                long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -80,6 +91,7 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase {
         */
        public Result_ShutdownScriptDecodeErrorZ clone() {
                long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;