[Java] Update auto-generated bindings to 0.0.115
[ldk-java] / src / main / java / org / ldk / structs / NodeAnnouncementInfo.java
index 565c82ce59aec431593c89dd0ebbf1a2530c1d6b..23559ffc3f7d5fa93673d13b7b62f07f889af261 100644 (file)
@@ -35,7 +35,7 @@ public class NodeAnnouncementInfo extends CommonBase {
        /**
         * Protocol features the node announced support for
         */
-       public void set_features(NodeFeatures val) {
+       public void set_features(org.ldk.structs.NodeFeatures val) {
                bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
@@ -99,41 +99,13 @@ public class NodeAnnouncementInfo extends CommonBase {
         * May be invalid or malicious (eg control chars),
         * should not be exposed to the user.
         */
-       public void set_alias(NodeAlias val) {
+       public void set_alias(org.ldk.structs.NodeAlias val) {
                bindings.NodeAnnouncementInfo_set_alias(this.ptr, val == null ? 0 : val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
        }
 
-       /**
-        * Internet-level addresses via which one can connect to the node
-        * 
-        * Returns a copy of the field.
-        */
-       public NetAddress[] get_addresses() {
-               long[] ret = bindings.NodeAnnouncementInfo_get_addresses(this.ptr);
-               Reference.reachabilityFence(this);
-               int ret_conv_12_len = ret.length;
-               NetAddress[] ret_conv_12_arr = new NetAddress[ret_conv_12_len];
-               for (int m = 0; m < ret_conv_12_len; m++) {
-                       long ret_conv_12 = ret[m];
-                       org.ldk.structs.NetAddress ret_conv_12_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret_conv_12);
-                       if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.add(this); };
-                       ret_conv_12_arr[m] = ret_conv_12_hu_conv;
-               }
-               return ret_conv_12_arr;
-       }
-
-       /**
-        * Internet-level addresses via which one can connect to the node
-        */
-       public void set_addresses(NetAddress[] val) {
-               bindings.NodeAnnouncementInfo_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null);
-               Reference.reachabilityFence(this);
-               Reference.reachabilityFence(val);
-       }
-
        /**
         * An initial announcement of the node
         * Mostly redundant with the data we store in fields explicitly.
@@ -160,7 +132,7 @@ public class NodeAnnouncementInfo extends CommonBase {
         * 
         * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_announcement_message(@Nullable NodeAnnouncement val) {
+       public void set_announcement_message(@Nullable org.ldk.structs.NodeAnnouncement val) {
                bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
@@ -170,13 +142,12 @@ public class NodeAnnouncementInfo extends CommonBase {
        /**
         * Constructs a new NodeAnnouncementInfo given each field
         */
-       public static NodeAnnouncementInfo of(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, NodeAlias alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
-               long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg == null ? 0 : alias_arg.ptr, addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray() : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr);
+       public static NodeAnnouncementInfo of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, org.ldk.structs.NodeAnnouncement announcement_message_arg) {
+               long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg == null ? 0 : alias_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr);
                Reference.reachabilityFence(features_arg);
                Reference.reachabilityFence(last_update_arg);
                Reference.reachabilityFence(rgb_arg);
                Reference.reachabilityFence(alias_arg);
-               Reference.reachabilityFence(addresses_arg);
                Reference.reachabilityFence(announcement_message_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); }
@@ -205,6 +176,40 @@ public class NodeAnnouncementInfo extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two NodeAnnouncementInfos contain equal inner contents.
+        * This ignores pointers and is_owned flags and looks at the values in fields.
+        * Two objects with NULL inner values will be considered "equal" here.
+        */
+       public boolean eq(org.ldk.structs.NodeAnnouncementInfo b) {
+               boolean ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b == null ? 0 : b.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(b);
+               if (this != null) { this.ptrs_to.add(b); };
+               return ret;
+       }
+
+       @Override public boolean equals(Object o) {
+               if (!(o instanceof NodeAnnouncementInfo)) return false;
+               return this.eq((NodeAnnouncementInfo)o);
+       }
+       /**
+        * Internet-level addresses via which one can connect to the node
+        */
+       public NetAddress[] addresses() {
+               long[] ret = bindings.NodeAnnouncementInfo_addresses(this.ptr);
+               Reference.reachabilityFence(this);
+               int ret_conv_12_len = ret.length;
+               NetAddress[] ret_conv_12_arr = new NetAddress[ret_conv_12_len];
+               for (int m = 0; m < ret_conv_12_len; m++) {
+                       long ret_conv_12 = ret[m];
+                       org.ldk.structs.NetAddress ret_conv_12_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret_conv_12);
+                       if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.add(this); };
+                       ret_conv_12_arr[m] = ret_conv_12_hu_conv;
+               }
+               return ret_conv_12_arr;
+       }
+
        /**
         * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
         */