[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / HTLCDestination.java
index a5c58c1d6f7028d229b40cff8aa3ef30fdf0cc78..8d0c94bd63521c110c339ec3190e8fe247f2019b 100644 (file)
@@ -102,7 +102,7 @@ public class HTLCDestination extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -115,7 +115,7 @@ public class HTLCDestination extends CommonBase {
                Reference.reachabilityFence(channel_id);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(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;
        }
 
@@ -127,7 +127,7 @@ public class HTLCDestination extends CommonBase {
                Reference.reachabilityFence(requested_forward_scid);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(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;
        }
 
@@ -139,10 +139,25 @@ public class HTLCDestination extends CommonBase {
                Reference.reachabilityFence(payment_hash);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(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;
        }
 
+       /**
+        * Checks if two HTLCDestinations contain equal inner contents.
+        * This ignores pointers and is_owned flags and looks at the values in fields.
+        */
+       public boolean eq(HTLCDestination b) {
+               boolean ret = bindings.HTLCDestination_eq(this.ptr, b == null ? 0 : b.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(b);
+               return ret;
+       }
+
+       @Override public boolean equals(Object o) {
+               if (!(o instanceof HTLCDestination)) return false;
+               return this.eq((HTLCDestination)o);
+       }
        /**
         * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
         */