[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / UnsignedChannelUpdate.java
index b22073917d76a97b84a9e19dc60c7ccd3b0ecdf0..7805cc07b208ec45311ac3105d1bdebdc72b713e 100644 (file)
@@ -196,6 +196,19 @@ public class UnsignedChannelUpdate extends CommonBase {
                Reference.reachabilityFence(val);
        }
 
+       /**
+        * Excess data which was signed as a part of the message which we do not (yet) understand how
+        * to decode. This is stored to ensure forward-compatibility as new fields are added to the
+        * lightning gossip
+        * 
+        * Returns a copy of the field.
+        */
+       public byte[] get_excess_data() {
+               byte[] ret = bindings.UnsignedChannelUpdate_get_excess_data(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Excess data which was signed as a part of the message which we do not (yet) understand how
         * to decode. This is stored to ensure forward-compatibility as new fields are added to the
@@ -224,7 +237,7 @@ public class UnsignedChannelUpdate extends CommonBase {
                Reference.reachabilityFence(excess_data_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -242,10 +255,27 @@ public class UnsignedChannelUpdate extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two UnsignedChannelUpdates 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(UnsignedChannelUpdate b) {
+               boolean ret = bindings.UnsignedChannelUpdate_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 UnsignedChannelUpdate)) return false;
+               return this.eq((UnsignedChannelUpdate)o);
+       }
        /**
         * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
         */