[Java] Update auto-generated Java bindings for 0.0.113
[ldk-java] / src / main / java / org / ldk / structs / ClosureReason.java
index ad198c32f0e626e5cd6b4ddf67d4d2678080bef6..2993d9340ab8148c86910e271543c7663426f25a 100644 (file)
@@ -62,7 +62,7 @@ public class ClosureReason extends CommonBase {
                 * or printed to stdout). Otherwise, a well crafted error message may exploit
                 * a security vulnerability in the terminal emulator or the logging subsystem.
                */
-               public final String peer_msg;
+               public final java.lang.String peer_msg;
                private CounterpartyForceClosed(long ptr, bindings.LDKClosureReason.CounterpartyForceClosed obj) {
                        super(null, ptr);
                        this.peer_msg = obj.peer_msg;
@@ -112,18 +112,23 @@ public class ClosureReason extends CommonBase {
                /**
                 * A developer-readable error message which we generated.
                */
-               public final String err;
+               public final java.lang.String err;
                private ProcessingError(long ptr, bindings.LDKClosureReason.ProcessingError obj) {
                        super(null, ptr);
                        this.err = obj.err;
                }
        }
        /**
-        * The `PeerManager` informed us that we've disconnected from the peer. We close channels
-        * if the `PeerManager` informed us that it is unlikely we'll be able to connect to the
-        * peer again in the future or if the peer disconnected before we finished negotiating
-        * the channel open. The first case may be caused by incompatible features which our
-        * counterparty, or we, require.
+        * The peer disconnected prior to funding completing. In this case the spec mandates that we
+        * forget the channel entirely - we can attempt again if the peer reconnects.
+        * 
+        * This includes cases where we restarted prior to funding completion, including prior to the
+        * initial [`ChannelMonitor`] persistence completing.
+        * 
+        * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
+        * peer because of mutual incompatibility between us and our channel counterparty.
+        * 
+        * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
         */
        public final static class DisconnectedPeer extends ClosureReason {
                private DisconnectedPeer(long ptr, bindings.LDKClosureReason.DisconnectedPeer obj) {
@@ -131,8 +136,11 @@ public class ClosureReason extends CommonBase {
                }
        }
        /**
-        * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
-        * the ChannelManager deserialized.
+        * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
+        * the [`ChannelManager`] deserialized.
+        * 
+        * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+        * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
         */
        public final static class OutdatedChannelManager extends ClosureReason {
                private OutdatedChannelManager(long ptr, bindings.LDKClosureReason.OutdatedChannelManager obj) {
@@ -152,8 +160,8 @@ public class ClosureReason extends CommonBase {
                long ret = bindings.ClosureReason_clone(this.ptr);
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -164,8 +172,8 @@ public class ClosureReason extends CommonBase {
                long ret = bindings.ClosureReason_counterparty_force_closed(peer_msg);
                Reference.reachabilityFence(peer_msg);
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -175,8 +183,8 @@ public class ClosureReason extends CommonBase {
        public static ClosureReason holder_force_closed() {
                long ret = bindings.ClosureReason_holder_force_closed();
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -186,8 +194,8 @@ public class ClosureReason extends CommonBase {
        public static ClosureReason cooperative_closure() {
                long ret = bindings.ClosureReason_cooperative_closure();
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -197,8 +205,8 @@ public class ClosureReason extends CommonBase {
        public static ClosureReason commitment_tx_confirmed() {
                long ret = bindings.ClosureReason_commitment_tx_confirmed();
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -208,8 +216,8 @@ public class ClosureReason extends CommonBase {
        public static ClosureReason funding_timed_out() {
                long ret = bindings.ClosureReason_funding_timed_out();
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -220,8 +228,8 @@ public class ClosureReason extends CommonBase {
                long ret = bindings.ClosureReason_processing_error(err);
                Reference.reachabilityFence(err);
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -231,8 +239,8 @@ public class ClosureReason extends CommonBase {
        public static ClosureReason disconnected_peer() {
                long ret = bindings.ClosureReason_disconnected_peer();
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -242,11 +250,26 @@ public class ClosureReason extends CommonBase {
        public static ClosureReason outdated_channel_manager() {
                long ret = bindings.ClosureReason_outdated_channel_manager();
                if (ret >= 0 && ret <= 4096) { return null; }
-               ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two ClosureReasons contain equal inner contents.
+        * This ignores pointers and is_owned flags and looks at the values in fields.
+        */
+       public boolean eq(org.ldk.structs.ClosureReason b) {
+               boolean ret = bindings.ClosureReason_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 ClosureReason)) return false;
+               return this.eq((ClosureReason)o);
+       }
        /**
         * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
         */