Update auto-generated bindings to 0.0.103
[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 javax.annotation.Nullable;
8
9
10 /**
11  * Number of attempts to retry payment path failures for an [`Invoice`].
12  * 
13  * Note that this is the number of *path* failures, not full payment retries. For multi-path
14  * payments, if this is less than the total number of paths, we will never even retry all of the
15  * payment's paths.
16  */
17 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
18 public class RetryAttempts extends CommonBase {
19         RetryAttempts(Object _dummy, long ptr) { super(ptr); }
20         @Override @SuppressWarnings("deprecation")
21         protected void finalize() throws Throwable {
22                 super.finalize();
23                 if (ptr != 0) { bindings.RetryAttempts_free(ptr); }
24         }
25
26         public long get_a() {
27                 long ret = bindings.RetryAttempts_get_a(this.ptr);
28                 return ret;
29         }
30
31         public void set_a(long val) {
32                 bindings.RetryAttempts_set_a(this.ptr, val);
33         }
34
35         /**
36          * Constructs a new RetryAttempts given each field
37          */
38         public static RetryAttempts of(long a_arg) {
39                 long ret = bindings.RetryAttempts_new(a_arg);
40                 if (ret >= 0 && ret <= 4096) { return null; }
41                 RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); }
42                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
43                 return ret_hu_conv;
44         }
45
46         /**
47          * Creates a copy of the RetryAttempts
48          */
49         public RetryAttempts clone() {
50                 long ret = bindings.RetryAttempts_clone(this.ptr);
51                 if (ret >= 0 && ret <= 4096) { return null; }
52                 RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); }
53                 ret_hu_conv.ptrs_to.add(this);
54                 return ret_hu_conv;
55         }
56
57         /**
58          * Checks if two RetryAttemptss contain equal inner contents.
59          * This ignores pointers and is_owned flags and looks at the values in fields.
60          * Two objects with NULL inner values will be considered "equal" here.
61          */
62         public boolean eq(RetryAttempts b) {
63                 boolean ret = bindings.RetryAttempts_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
64                 this.ptrs_to.add(b);
65                 return ret;
66         }
67
68         /**
69          * Checks if two RetryAttemptss contain equal inner contents.
70          */
71         public long hash() {
72                 long ret = bindings.RetryAttempts_hash(this.ptr);
73                 return ret;
74         }
75
76 }