Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / RetryAttempts.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * Number of attempts to retry payment path failures for an [`Invoice`].
13  * 
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
16  * payment's paths.
17  */
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 {
23                 super.finalize();
24                 if (ptr != 0) { bindings.RetryAttempts_free(ptr); }
25         }
26
27         public long get_a() {
28                 long ret = bindings.RetryAttempts_get_a(this.ptr);
29                 Reference.reachabilityFence(this);
30                 return ret;
31         }
32
33         public void set_a(long val) {
34                 bindings.RetryAttempts_set_a(this.ptr, val);
35                 Reference.reachabilityFence(this);
36                 Reference.reachabilityFence(val);
37         }
38
39         /**
40          * Constructs a new RetryAttempts given each field
41          */
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);
48                 return ret_hu_conv;
49         }
50
51         long clone_ptr() {
52                 long ret = bindings.RetryAttempts_clone_ptr(this.ptr);
53                 Reference.reachabilityFence(this);
54                 return ret;
55         }
56
57         /**
58          * Creates a copy of the RetryAttempts
59          */
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);
66                 return ret_hu_conv;
67         }
68
69         /**
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.
73          */
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);
78                 this.ptrs_to.add(b);
79                 return ret;
80         }
81
82         @Override public boolean equals(Object o) {
83                 if (!(o instanceof RetryAttempts)) return false;
84                 return this.eq((RetryAttempts)o);
85         }
86         /**
87          * Checks if two RetryAttemptss contain equal inner contents.
88          */
89         public long hash() {
90                 long ret = bindings.RetryAttempts_hash(this.ptr);
91                 Reference.reachabilityFence(this);
92                 return ret;
93         }
94
95         @Override public int hashCode() {
96                 return (int)this.hash();
97         }
98 }