[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / Bolt12InvoiceFeatures.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  * Features used within an `invoice`.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class Bolt12InvoiceFeatures extends CommonBase {
16         Bolt12InvoiceFeatures(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.Bolt12InvoiceFeatures_free(ptr); }
21         }
22
23         /**
24          * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
25          * This ignores pointers and is_owned flags and looks at the values in fields.
26          * Two objects with NULL inner values will be considered "equal" here.
27          */
28         public boolean eq(org.ldk.structs.Bolt12InvoiceFeatures b) {
29                 boolean ret = bindings.Bolt12InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr);
30                 Reference.reachabilityFence(this);
31                 Reference.reachabilityFence(b);
32                 if (this != null) { this.ptrs_to.add(b); };
33                 return ret;
34         }
35
36         @Override public boolean equals(Object o) {
37                 if (!(o instanceof Bolt12InvoiceFeatures)) return false;
38                 return this.eq((Bolt12InvoiceFeatures)o);
39         }
40         long clone_ptr() {
41                 long ret = bindings.Bolt12InvoiceFeatures_clone_ptr(this.ptr);
42                 Reference.reachabilityFence(this);
43                 return ret;
44         }
45
46         /**
47          * Creates a copy of the Bolt12InvoiceFeatures
48          */
49         public Bolt12InvoiceFeatures clone() {
50                 long ret = bindings.Bolt12InvoiceFeatures_clone(this.ptr);
51                 Reference.reachabilityFence(this);
52                 if (ret >= 0 && ret <= 4096) { return null; }
53                 org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); }
54                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
55                 return ret_hu_conv;
56         }
57
58         /**
59          * Create a blank Features with no features set
60          */
61         public static Bolt12InvoiceFeatures empty() {
62                 long ret = bindings.Bolt12InvoiceFeatures_empty();
63                 if (ret >= 0 && ret <= 4096) { return null; }
64                 org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); }
65                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
66                 return ret_hu_conv;
67         }
68
69         /**
70          * Returns true if this `Features` object contains unknown feature flags which are set as
71          * \"required\".
72          */
73         public boolean requires_unknown_bits() {
74                 boolean ret = bindings.Bolt12InvoiceFeatures_requires_unknown_bits(this.ptr);
75                 Reference.reachabilityFence(this);
76                 return ret;
77         }
78
79         /**
80          * Set this feature as optional.
81          */
82         public void set_basic_mpp_optional() {
83                 bindings.Bolt12InvoiceFeatures_set_basic_mpp_optional(this.ptr);
84                 Reference.reachabilityFence(this);
85         }
86
87         /**
88          * Set this feature as required.
89          */
90         public void set_basic_mpp_required() {
91                 bindings.Bolt12InvoiceFeatures_set_basic_mpp_required(this.ptr);
92                 Reference.reachabilityFence(this);
93         }
94
95         /**
96          * Checks if this feature is supported.
97          */
98         public boolean supports_basic_mpp() {
99                 boolean ret = bindings.Bolt12InvoiceFeatures_supports_basic_mpp(this.ptr);
100                 Reference.reachabilityFence(this);
101                 return ret;
102         }
103
104         /**
105          * Checks if this feature is required.
106          */
107         public boolean requires_basic_mpp() {
108                 boolean ret = bindings.Bolt12InvoiceFeatures_requires_basic_mpp(this.ptr);
109                 Reference.reachabilityFence(this);
110                 return ret;
111         }
112
113 }