[Java] Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelInfo.java
index 61b4bce3e2b0f0251f990c3cf1fe11847c9e8952..aad7e4c068cfffcf562f544babefb03a55edf15e 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;
 
 
@@ -25,6 +26,7 @@ public class ChannelInfo extends CommonBase {
         */
        public ChannelFeatures get_features() {
                long ret = bindings.ChannelInfo_get_features(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
@@ -36,6 +38,8 @@ public class ChannelInfo extends CommonBase {
         */
        public void set_features(ChannelFeatures val) {
                bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -43,6 +47,7 @@ public class ChannelInfo extends CommonBase {
         */
        public NodeId get_node_one() {
                long ret = bindings.ChannelInfo_get_node_one(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
@@ -54,6 +59,8 @@ public class ChannelInfo extends CommonBase {
         */
        public void set_node_one(NodeId val) {
                bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr & ~1);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -62,10 +69,11 @@ public class ChannelInfo extends CommonBase {
         * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        @Nullable
-       public DirectionalChannelInfo get_one_to_two() {
+       public ChannelUpdateInfo get_one_to_two() {
                long ret = bindings.ChannelInfo_get_one_to_two(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               DirectionalChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectionalChannelInfo(null, ret); }
+               ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -75,8 +83,10 @@ public class ChannelInfo extends CommonBase {
         * 
         * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_one_to_two(@Nullable DirectionalChannelInfo val) {
+       public void set_one_to_two(@Nullable ChannelUpdateInfo val) {
                bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -84,6 +94,7 @@ public class ChannelInfo extends CommonBase {
         */
        public NodeId get_node_two() {
                long ret = bindings.ChannelInfo_get_node_two(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
@@ -95,6 +106,8 @@ public class ChannelInfo extends CommonBase {
         */
        public void set_node_two(NodeId val) {
                bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr & ~1);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -103,10 +116,11 @@ public class ChannelInfo extends CommonBase {
         * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        @Nullable
-       public DirectionalChannelInfo get_two_to_one() {
+       public ChannelUpdateInfo get_two_to_one() {
                long ret = bindings.ChannelInfo_get_two_to_one(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               DirectionalChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectionalChannelInfo(null, ret); }
+               ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -116,8 +130,10 @@ public class ChannelInfo extends CommonBase {
         * 
         * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_two_to_one(@Nullable DirectionalChannelInfo val) {
+       public void set_two_to_one(@Nullable ChannelUpdateInfo val) {
                bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -125,8 +141,9 @@ public class ChannelInfo extends CommonBase {
         */
        public Option_u64Z get_capacity_sats() {
                long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
+               org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -136,6 +153,8 @@ public class ChannelInfo extends CommonBase {
         */
        public void set_capacity_sats(Option_u64Z val) {
                bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -149,6 +168,7 @@ public class ChannelInfo extends CommonBase {
        @Nullable
        public ChannelAnnouncement get_announcement_message() {
                long ret = bindings.ChannelInfo_get_announcement_message(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
@@ -165,21 +185,13 @@ public class ChannelInfo extends CommonBase {
         */
        public void set_announcement_message(@Nullable ChannelAnnouncement val) {
                bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
-       }
-
-       /**
-        * Constructs a new ChannelInfo given each field
-        */
-       public static ChannelInfo of(ChannelFeatures features_arg, NodeId node_one_arg, DirectionalChannelInfo one_to_two_arg, NodeId node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) {
-               long ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg == null ? 0 : node_one_arg.ptr & ~1, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg == null ? 0 : node_two_arg.ptr & ~1, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
-               if (ret >= 0 && ret <= 4096) { return null; }
-               ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelInfo(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
-               return ret_hu_conv;
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        long clone_ptr() {
                long ret = bindings.ChannelInfo_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -188,6 +200,7 @@ public class ChannelInfo extends CommonBase {
         */
        public ChannelInfo clone() {
                long ret = bindings.ChannelInfo_clone(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelInfo(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
@@ -199,6 +212,7 @@ public class ChannelInfo extends CommonBase {
         */
        public byte[] write() {
                byte[] ret = bindings.ChannelInfo_write(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -207,6 +221,7 @@ public class ChannelInfo extends CommonBase {
         */
        public static Result_ChannelInfoDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelInfo_read(ser);
+               Reference.reachabilityFence(ser);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;