1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Number of attempts to retry payment path failures for an [`Invoice`].
14 * Note that this is the number of *path* failures, not full payment retries. For multi-path
15 * payments, if this is less than the total number of paths, we will never even retry all of the
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class RetryAttempts extends CommonBase {
20 RetryAttempts(Object _dummy, long ptr) { super(ptr); }
21 @Override @SuppressWarnings("deprecation")
22 protected void finalize() throws Throwable {
24 if (ptr != 0) { bindings.RetryAttempts_free(ptr); }
28 long ret = bindings.RetryAttempts_get_a(this.ptr);
29 Reference.reachabilityFence(this);
33 public void set_a(long val) {
34 bindings.RetryAttempts_set_a(this.ptr, val);
35 Reference.reachabilityFence(this);
36 Reference.reachabilityFence(val);
40 * Constructs a new RetryAttempts given each field
42 public static RetryAttempts of(long a_arg) {
43 long ret = bindings.RetryAttempts_new(a_arg);
44 Reference.reachabilityFence(a_arg);
45 if (ret >= 0 && ret <= 4096) { return null; }
46 RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); }
47 ret_hu_conv.ptrs_to.add(ret_hu_conv);
52 long ret = bindings.RetryAttempts_clone_ptr(this.ptr);
53 Reference.reachabilityFence(this);
58 * Creates a copy of the RetryAttempts
60 public RetryAttempts clone() {
61 long ret = bindings.RetryAttempts_clone(this.ptr);
62 Reference.reachabilityFence(this);
63 if (ret >= 0 && ret <= 4096) { return null; }
64 RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); }
65 ret_hu_conv.ptrs_to.add(this);
70 * Checks if two RetryAttemptss contain equal inner contents.
71 * This ignores pointers and is_owned flags and looks at the values in fields.
72 * Two objects with NULL inner values will be considered "equal" here.
74 public boolean eq(RetryAttempts b) {
75 boolean ret = bindings.RetryAttempts_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
76 Reference.reachabilityFence(this);
77 Reference.reachabilityFence(b);
82 @Override public boolean equals(Object o) {
83 if (!(o instanceof RetryAttempts)) return false;
84 return this.eq((RetryAttempts)o);
87 * Checks if two RetryAttemptss contain equal inner contents.
90 long ret = bindings.RetryAttempts_hash(this.ptr);
91 Reference.reachabilityFence(this);
95 @Override public int hashCode() {
96 return (int)this.hash();