6 namespace org { namespace ldk { namespace structs {
10 * Features used within an invoice.
12 public class InvoiceFeatures : CommonBase {
13 internal InvoiceFeatures(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.InvoiceFeatures_free(ptr); }
19 * Checks if two InvoiceFeaturess contain equal inner contents.
20 * This ignores pointers and is_owned flags and looks at the values in fields.
21 * Two objects with NULL inner values will be considered "equal" here.
23 public bool eq(org.ldk.structs.InvoiceFeatures b) {
24 bool ret = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr);
27 if (this != null) { this.ptrs_to.AddLast(b); };
31 public override bool Equals(object o) {
32 if (!(o is InvoiceFeatures)) return false;
33 return this.eq((InvoiceFeatures)o);
35 internal long clone_ptr() {
36 long ret = bindings.InvoiceFeatures_clone_ptr(this.ptr);
42 * Creates a copy of the InvoiceFeatures
44 public InvoiceFeatures clone() {
45 long ret = bindings.InvoiceFeatures_clone(this.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); }
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
54 * Create a blank Features with no features set
56 public static InvoiceFeatures empty() {
57 long ret = bindings.InvoiceFeatures_empty();
58 if (ret >= 0 && ret <= 4096) { return null; }
59 org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); }
60 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
65 * Returns true if this `Features` object contains unknown feature flags which are set as
68 public bool requires_unknown_bits() {
69 bool ret = bindings.InvoiceFeatures_requires_unknown_bits(this.ptr);
75 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
77 public byte[] write() {
78 byte[] ret = bindings.InvoiceFeatures_write(this.ptr);
84 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
86 public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) {
87 long ret = bindings.InvoiceFeatures_read(ser);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
95 * Set this feature as optional.
97 public void set_variable_length_onion_optional() {
98 bindings.InvoiceFeatures_set_variable_length_onion_optional(this.ptr);
103 * Set this feature as required.
105 public void set_variable_length_onion_required() {
106 bindings.InvoiceFeatures_set_variable_length_onion_required(this.ptr);
111 * Checks if this feature is supported.
113 public bool supports_variable_length_onion() {
114 bool ret = bindings.InvoiceFeatures_supports_variable_length_onion(this.ptr);
120 * Checks if this feature is required.
122 public bool requires_variable_length_onion() {
123 bool ret = bindings.InvoiceFeatures_requires_variable_length_onion(this.ptr);
129 * Set this feature as optional.
131 public void set_payment_secret_optional() {
132 bindings.InvoiceFeatures_set_payment_secret_optional(this.ptr);
137 * Set this feature as required.
139 public void set_payment_secret_required() {
140 bindings.InvoiceFeatures_set_payment_secret_required(this.ptr);
145 * Checks if this feature is supported.
147 public bool supports_payment_secret() {
148 bool ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr);
154 * Checks if this feature is required.
156 public bool requires_payment_secret() {
157 bool ret = bindings.InvoiceFeatures_requires_payment_secret(this.ptr);
163 * Set this feature as optional.
165 public void set_basic_mpp_optional() {
166 bindings.InvoiceFeatures_set_basic_mpp_optional(this.ptr);
171 * Set this feature as required.
173 public void set_basic_mpp_required() {
174 bindings.InvoiceFeatures_set_basic_mpp_required(this.ptr);
179 * Checks if this feature is supported.
181 public bool supports_basic_mpp() {
182 bool ret = bindings.InvoiceFeatures_supports_basic_mpp(this.ptr);
188 * Checks if this feature is required.
190 public bool requires_basic_mpp() {
191 bool ret = bindings.InvoiceFeatures_requires_basic_mpp(this.ptr);