[Java] Update auto-generated Java bindings for 0.0.113
[ldk-java] / src / main / java / org / ldk / structs / AcceptChannel.java
index aee61b8f7ca45bf4553b85d0d16b6372bdac2a93..fd6f23b0320b43619f9054ccc10b3c14c5e79f3f 100644 (file)
@@ -287,7 +287,7 @@ public class AcceptChannel extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(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;
        }
 
@@ -300,10 +300,11 @@ public class AcceptChannel extends CommonBase {
         * 
         * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_channel_type(@Nullable ChannelTypeFeatures val) {
-               bindings.AcceptChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr & ~1);
+       public void set_channel_type(@Nullable org.ldk.structs.ChannelTypeFeatures val) {
+               bindings.AcceptChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
+               if (this != null) { this.ptrs_to.add(val); };
        }
 
        long clone_ptr() {
@@ -320,10 +321,27 @@ public class AcceptChannel extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannel(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 AcceptChannels 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.AcceptChannel b) {
+               boolean ret = bindings.AcceptChannel_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 AcceptChannel)) return false;
+               return this.eq((AcceptChannel)o);
+       }
        /**
         * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
         */