[TS] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1
[ldk-java] / src / main / java / org / ldk / structs / PaymentSendFailure.java
index 4eafa113a16979f6193dab9b774243c4844a65ff..5805c66baa48bad25f52e1995d69e855bdcedab7 100644 (file)
@@ -9,11 +9,11 @@ import javax.annotation.Nullable;
 
 
 /**
- * If a payment fails to send with [`ChannelManager::send_payment`], it can be in one of several
- * states. This enum is returned as the Err() type describing which state the payment is in, see
- * the description of individual enum states for more.
+ * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
+ * of several states. This enum is returned as the Err() type describing which state the payment
+ * is in, see the description of individual enum states for more.
  * 
- * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
  */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class PaymentSendFailure extends CommonBase {
@@ -52,8 +52,8 @@ public class PaymentSendFailure extends CommonBase {
         * Because the payment failed outright, no payment tracking is done and no
         * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
         * 
-        * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
-        * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
+        * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
+        * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
         */
        public final static class ParameterError extends PaymentSendFailure {
                public final org.ldk.structs.APIError parameter_error;
@@ -77,8 +77,8 @@ public class PaymentSendFailure extends CommonBase {
         * The results here are ordered the same as the paths in the route object which was passed to
         * send_payment.
         * 
-        * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
-        * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
+        * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
+        * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
         */
        public final static class PathParameterError extends PaymentSendFailure {
                public final Result_NoneAPIErrorZ[] path_parameter_error;
@@ -103,8 +103,8 @@ public class PaymentSendFailure extends CommonBase {
         * Because the payment failed outright, no payment tracking is done and no
         * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
         * 
-        * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
-        * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
+        * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
+        * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
         */
        public final static class AllFailedResendSafe extends PaymentSendFailure {
                public final APIError[] all_failed_resend_safe;
@@ -127,8 +127,8 @@ public class PaymentSendFailure extends CommonBase {
         * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
         * 
         * [`PaymentId`]: crate::ln::channelmanager::PaymentId
-        * [`Event::PaymentSent`]: crate::util::events::Event::PaymentSent
-        * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
+        * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
+        * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
         */
        public final static class DuplicatePayment extends PaymentSendFailure {
                private DuplicatePayment(long ptr, bindings.LDKPaymentSendFailure.DuplicatePayment obj) {
@@ -216,7 +216,7 @@ public class PaymentSendFailure extends CommonBase {
         * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
         */
        public static PaymentSendFailure path_parameter_error(Result_NoneAPIErrorZ[] a) {
-               long ret = bindings.PaymentSendFailure_path_parameter_error(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray() : null);
+               long ret = bindings.PaymentSendFailure_path_parameter_error(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22.ptr).toArray() : null);
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret);
@@ -252,7 +252,7 @@ public class PaymentSendFailure extends CommonBase {
         * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
         */
        public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] results, org.ldk.structs.RouteParameters failed_paths_retry, byte[] payment_id) {
-               long ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).mapToLong(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray() : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr, InternalUtils.check_arr_len(payment_id, 32));
+               long ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).mapToLong(results_conv_22 -> results_conv_22.ptr).toArray() : null, failed_paths_retry.ptr, InternalUtils.check_arr_len(payment_id, 32));
                Reference.reachabilityFence(results);
                Reference.reachabilityFence(failed_paths_retry);
                Reference.reachabilityFence(payment_id);
@@ -263,4 +263,19 @@ public class PaymentSendFailure extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two PaymentSendFailures contain equal inner contents.
+        * This ignores pointers and is_owned flags and looks at the values in fields.
+        */
+       public boolean eq(org.ldk.structs.PaymentSendFailure b) {
+               boolean ret = bindings.PaymentSendFailure_eq(this.ptr, b.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(b);
+               return ret;
+       }
+
+       @Override public boolean equals(Object o) {
+               if (!(o instanceof PaymentSendFailure)) return false;
+               return this.eq((PaymentSendFailure)o);
+       }
 }