Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / InvoiceFeatures.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
8
9 /**
10  * Features used within an invoice.
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class InvoiceFeatures extends CommonBase {
14         InvoiceFeatures(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.InvoiceFeatures_free(ptr); }
19         }
20
21         /**
22          * Checks if two InvoiceFeaturess contain equal inner contents.
23          * This ignores pointers and is_owned flags and looks at the values in fields.
24          * Two objects with NULL inner values will be considered "equal" here.
25          */
26         public boolean eq(InvoiceFeatures b) {
27                 boolean ret = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
28                 this.ptrs_to.add(b);
29                 return ret;
30         }
31
32         /**
33          * Creates a copy of the InvoiceFeatures
34          */
35         public InvoiceFeatures clone() {
36                 long ret = bindings.InvoiceFeatures_clone(this.ptr);
37                 if (ret < 1024) { return null; }
38                 InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
39                 ret_hu_conv.ptrs_to.add(this);
40                 return ret_hu_conv;
41         }
42
43         /**
44          * Create a blank Features with no features set
45          */
46         public static InvoiceFeatures empty() {
47                 long ret = bindings.InvoiceFeatures_empty();
48                 if (ret < 1024) { return null; }
49                 InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
50                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
51                 return ret_hu_conv;
52         }
53
54         /**
55          * Creates a Features with the bits set which are known by the implementation
56          */
57         public static InvoiceFeatures known() {
58                 long ret = bindings.InvoiceFeatures_known();
59                 if (ret < 1024) { return null; }
60                 InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
61                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
62                 return ret_hu_conv;
63         }
64
65         /**
66          * Returns whether the `payment_secret` feature is supported.
67          */
68         public boolean supports_payment_secret() {
69                 boolean ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr);
70                 return ret;
71         }
72
73         /**
74          * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
75          */
76         public byte[] write() {
77                 byte[] ret = bindings.InvoiceFeatures_write(this.ptr);
78                 return ret;
79         }
80
81         /**
82          * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
83          */
84         public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) {
85                 long ret = bindings.InvoiceFeatures_read(ser);
86                 if (ret < 1024) { return null; }
87                 Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
88                 return ret_hu_conv;
89         }
90
91 }