[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / Pong.java
index 9e32c65a1d6cb77e2d5a3b24ee120a3b027668a8..0a3b39534fbd346868631d71899892eb2fb427ce 100644 (file)
@@ -9,7 +9,9 @@ import javax.annotation.Nullable;
 
 
 /**
- * A pong message to be sent or received from a peer
+ * A [`pong`] message to be sent to or received from a peer.
+ * 
+ * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
  */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class Pong extends CommonBase {
@@ -22,6 +24,7 @@ public class Pong extends CommonBase {
 
        /**
         * The pong packet size.
+        * 
         * This field is not sent on the wire. byteslen zeros are sent.
         */
        public short get_byteslen() {
@@ -32,6 +35,7 @@ public class Pong extends CommonBase {
 
        /**
         * The pong packet size.
+        * 
         * This field is not sent on the wire. byteslen zeros are sent.
         */
        public void set_byteslen(short val) {
@@ -47,8 +51,8 @@ public class Pong extends CommonBase {
                long ret = bindings.Pong_new(byteslen_arg);
                Reference.reachabilityFence(byteslen_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
-               Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Pong(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Pong(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -65,11 +69,28 @@ public class Pong extends CommonBase {
                long ret = bindings.Pong_clone(this.ptr);
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Pong(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Pong(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two Pongs 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.Pong b) {
+               boolean ret = bindings.Pong_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 Pong)) return false;
+               return this.eq((Pong)o);
+       }
        /**
         * Serialize the Pong object into a byte array which can be read by Pong_read
         */