[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / ClosingSigned.java
index 62c5d302827e19820161c2061c238eb4ae24a0aa..eee1fcd1410476febf4b05bce040997bcf5bc6ce 100644 (file)
@@ -86,7 +86,7 @@ public class ClosingSigned extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(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;
        }
 
@@ -100,7 +100,7 @@ public class ClosingSigned extends CommonBase {
                bindings.ClosingSigned_set_fee_range(this.ptr, val == null ? 0 : val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
-               this.ptrs_to.add(val);
+               if (this != null) { this.ptrs_to.add(val); };
        }
 
        /**
@@ -114,8 +114,8 @@ public class ClosingSigned extends CommonBase {
                Reference.reachabilityFence(fee_range_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
-               ret_hu_conv.ptrs_to.add(fee_range_arg);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fee_range_arg); };
                return ret_hu_conv;
        }
 
@@ -133,10 +133,27 @@ public class ClosingSigned extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(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 ClosingSigneds 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(ClosingSigned b) {
+               boolean ret = bindings.ClosingSigned_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 ClosingSigned)) return false;
+               return this.eq((ClosingSigned)o);
+       }
        /**
         * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
         */