[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / NodeFeatures.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 a `node_announcement` message.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class NodeFeatures extends CommonBase {
16         NodeFeatures(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.NodeFeatures_free(ptr); }
21         }
22
23         /**
24          * Checks if two NodeFeaturess 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.NodeFeatures b) {
29                 boolean ret = bindings.NodeFeatures_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 NodeFeatures)) return false;
38                 return this.eq((NodeFeatures)o);
39         }
40         long clone_ptr() {
41                 long ret = bindings.NodeFeatures_clone_ptr(this.ptr);
42                 Reference.reachabilityFence(this);
43                 return ret;
44         }
45
46         /**
47          * Creates a copy of the NodeFeatures
48          */
49         public NodeFeatures clone() {
50                 long ret = bindings.NodeFeatures_clone(this.ptr);
51                 Reference.reachabilityFence(this);
52                 if (ret >= 0 && ret <= 4096) { return null; }
53                 org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(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 NodeFeatures empty() {
62                 long ret = bindings.NodeFeatures_empty();
63                 if (ret >= 0 && ret <= 4096) { return null; }
64                 org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(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.NodeFeatures_requires_unknown_bits(this.ptr);
75                 Reference.reachabilityFence(this);
76                 return ret;
77         }
78
79         /**
80          * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
81          */
82         public byte[] write() {
83                 byte[] ret = bindings.NodeFeatures_write(this.ptr);
84                 Reference.reachabilityFence(this);
85                 return ret;
86         }
87
88         /**
89          * Read a NodeFeatures from a byte array, created by NodeFeatures_write
90          */
91         public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) {
92                 long ret = bindings.NodeFeatures_read(ser);
93                 Reference.reachabilityFence(ser);
94                 if (ret >= 0 && ret <= 4096) { return null; }
95                 Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
96                 return ret_hu_conv;
97         }
98
99         /**
100          * Set this feature as optional.
101          */
102         public void set_data_loss_protect_optional() {
103                 bindings.NodeFeatures_set_data_loss_protect_optional(this.ptr);
104                 Reference.reachabilityFence(this);
105         }
106
107         /**
108          * Set this feature as required.
109          */
110         public void set_data_loss_protect_required() {
111                 bindings.NodeFeatures_set_data_loss_protect_required(this.ptr);
112                 Reference.reachabilityFence(this);
113         }
114
115         /**
116          * Checks if this feature is supported.
117          */
118         public boolean supports_data_loss_protect() {
119                 boolean ret = bindings.NodeFeatures_supports_data_loss_protect(this.ptr);
120                 Reference.reachabilityFence(this);
121                 return ret;
122         }
123
124         /**
125          * Checks if this feature is required.
126          */
127         public boolean requires_data_loss_protect() {
128                 boolean ret = bindings.NodeFeatures_requires_data_loss_protect(this.ptr);
129                 Reference.reachabilityFence(this);
130                 return ret;
131         }
132
133         /**
134          * Set this feature as optional.
135          */
136         public void set_upfront_shutdown_script_optional() {
137                 bindings.NodeFeatures_set_upfront_shutdown_script_optional(this.ptr);
138                 Reference.reachabilityFence(this);
139         }
140
141         /**
142          * Set this feature as required.
143          */
144         public void set_upfront_shutdown_script_required() {
145                 bindings.NodeFeatures_set_upfront_shutdown_script_required(this.ptr);
146                 Reference.reachabilityFence(this);
147         }
148
149         /**
150          * Checks if this feature is supported.
151          */
152         public boolean supports_upfront_shutdown_script() {
153                 boolean ret = bindings.NodeFeatures_supports_upfront_shutdown_script(this.ptr);
154                 Reference.reachabilityFence(this);
155                 return ret;
156         }
157
158         /**
159          * Checks if this feature is required.
160          */
161         public boolean requires_upfront_shutdown_script() {
162                 boolean ret = bindings.NodeFeatures_requires_upfront_shutdown_script(this.ptr);
163                 Reference.reachabilityFence(this);
164                 return ret;
165         }
166
167         /**
168          * Set this feature as optional.
169          */
170         public void set_gossip_queries_optional() {
171                 bindings.NodeFeatures_set_gossip_queries_optional(this.ptr);
172                 Reference.reachabilityFence(this);
173         }
174
175         /**
176          * Set this feature as required.
177          */
178         public void set_gossip_queries_required() {
179                 bindings.NodeFeatures_set_gossip_queries_required(this.ptr);
180                 Reference.reachabilityFence(this);
181         }
182
183         /**
184          * Checks if this feature is supported.
185          */
186         public boolean supports_gossip_queries() {
187                 boolean ret = bindings.NodeFeatures_supports_gossip_queries(this.ptr);
188                 Reference.reachabilityFence(this);
189                 return ret;
190         }
191
192         /**
193          * Checks if this feature is required.
194          */
195         public boolean requires_gossip_queries() {
196                 boolean ret = bindings.NodeFeatures_requires_gossip_queries(this.ptr);
197                 Reference.reachabilityFence(this);
198                 return ret;
199         }
200
201         /**
202          * Set this feature as optional.
203          */
204         public void set_variable_length_onion_optional() {
205                 bindings.NodeFeatures_set_variable_length_onion_optional(this.ptr);
206                 Reference.reachabilityFence(this);
207         }
208
209         /**
210          * Set this feature as required.
211          */
212         public void set_variable_length_onion_required() {
213                 bindings.NodeFeatures_set_variable_length_onion_required(this.ptr);
214                 Reference.reachabilityFence(this);
215         }
216
217         /**
218          * Checks if this feature is supported.
219          */
220         public boolean supports_variable_length_onion() {
221                 boolean ret = bindings.NodeFeatures_supports_variable_length_onion(this.ptr);
222                 Reference.reachabilityFence(this);
223                 return ret;
224         }
225
226         /**
227          * Checks if this feature is required.
228          */
229         public boolean requires_variable_length_onion() {
230                 boolean ret = bindings.NodeFeatures_requires_variable_length_onion(this.ptr);
231                 Reference.reachabilityFence(this);
232                 return ret;
233         }
234
235         /**
236          * Set this feature as optional.
237          */
238         public void set_static_remote_key_optional() {
239                 bindings.NodeFeatures_set_static_remote_key_optional(this.ptr);
240                 Reference.reachabilityFence(this);
241         }
242
243         /**
244          * Set this feature as required.
245          */
246         public void set_static_remote_key_required() {
247                 bindings.NodeFeatures_set_static_remote_key_required(this.ptr);
248                 Reference.reachabilityFence(this);
249         }
250
251         /**
252          * Checks if this feature is supported.
253          */
254         public boolean supports_static_remote_key() {
255                 boolean ret = bindings.NodeFeatures_supports_static_remote_key(this.ptr);
256                 Reference.reachabilityFence(this);
257                 return ret;
258         }
259
260         /**
261          * Checks if this feature is required.
262          */
263         public boolean requires_static_remote_key() {
264                 boolean ret = bindings.NodeFeatures_requires_static_remote_key(this.ptr);
265                 Reference.reachabilityFence(this);
266                 return ret;
267         }
268
269         /**
270          * Set this feature as optional.
271          */
272         public void set_payment_secret_optional() {
273                 bindings.NodeFeatures_set_payment_secret_optional(this.ptr);
274                 Reference.reachabilityFence(this);
275         }
276
277         /**
278          * Set this feature as required.
279          */
280         public void set_payment_secret_required() {
281                 bindings.NodeFeatures_set_payment_secret_required(this.ptr);
282                 Reference.reachabilityFence(this);
283         }
284
285         /**
286          * Checks if this feature is supported.
287          */
288         public boolean supports_payment_secret() {
289                 boolean ret = bindings.NodeFeatures_supports_payment_secret(this.ptr);
290                 Reference.reachabilityFence(this);
291                 return ret;
292         }
293
294         /**
295          * Checks if this feature is required.
296          */
297         public boolean requires_payment_secret() {
298                 boolean ret = bindings.NodeFeatures_requires_payment_secret(this.ptr);
299                 Reference.reachabilityFence(this);
300                 return ret;
301         }
302
303         /**
304          * Set this feature as optional.
305          */
306         public void set_basic_mpp_optional() {
307                 bindings.NodeFeatures_set_basic_mpp_optional(this.ptr);
308                 Reference.reachabilityFence(this);
309         }
310
311         /**
312          * Set this feature as required.
313          */
314         public void set_basic_mpp_required() {
315                 bindings.NodeFeatures_set_basic_mpp_required(this.ptr);
316                 Reference.reachabilityFence(this);
317         }
318
319         /**
320          * Checks if this feature is supported.
321          */
322         public boolean supports_basic_mpp() {
323                 boolean ret = bindings.NodeFeatures_supports_basic_mpp(this.ptr);
324                 Reference.reachabilityFence(this);
325                 return ret;
326         }
327
328         /**
329          * Checks if this feature is required.
330          */
331         public boolean requires_basic_mpp() {
332                 boolean ret = bindings.NodeFeatures_requires_basic_mpp(this.ptr);
333                 Reference.reachabilityFence(this);
334                 return ret;
335         }
336
337         /**
338          * Set this feature as optional.
339          */
340         public void set_wumbo_optional() {
341                 bindings.NodeFeatures_set_wumbo_optional(this.ptr);
342                 Reference.reachabilityFence(this);
343         }
344
345         /**
346          * Set this feature as required.
347          */
348         public void set_wumbo_required() {
349                 bindings.NodeFeatures_set_wumbo_required(this.ptr);
350                 Reference.reachabilityFence(this);
351         }
352
353         /**
354          * Checks if this feature is supported.
355          */
356         public boolean supports_wumbo() {
357                 boolean ret = bindings.NodeFeatures_supports_wumbo(this.ptr);
358                 Reference.reachabilityFence(this);
359                 return ret;
360         }
361
362         /**
363          * Checks if this feature is required.
364          */
365         public boolean requires_wumbo() {
366                 boolean ret = bindings.NodeFeatures_requires_wumbo(this.ptr);
367                 Reference.reachabilityFence(this);
368                 return ret;
369         }
370
371         /**
372          * Set this feature as optional.
373          */
374         public void set_anchors_zero_fee_htlc_tx_optional() {
375                 bindings.NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this.ptr);
376                 Reference.reachabilityFence(this);
377         }
378
379         /**
380          * Set this feature as required.
381          */
382         public void set_anchors_zero_fee_htlc_tx_required() {
383                 bindings.NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this.ptr);
384                 Reference.reachabilityFence(this);
385         }
386
387         /**
388          * Checks if this feature is supported.
389          */
390         public boolean supports_anchors_zero_fee_htlc_tx() {
391                 boolean ret = bindings.NodeFeatures_supports_anchors_zero_fee_htlc_tx(this.ptr);
392                 Reference.reachabilityFence(this);
393                 return ret;
394         }
395
396         /**
397          * Checks if this feature is required.
398          */
399         public boolean requires_anchors_zero_fee_htlc_tx() {
400                 boolean ret = bindings.NodeFeatures_requires_anchors_zero_fee_htlc_tx(this.ptr);
401                 Reference.reachabilityFence(this);
402                 return ret;
403         }
404
405         /**
406          * Set this feature as optional.
407          */
408         public void set_shutdown_any_segwit_optional() {
409                 bindings.NodeFeatures_set_shutdown_any_segwit_optional(this.ptr);
410                 Reference.reachabilityFence(this);
411         }
412
413         /**
414          * Set this feature as required.
415          */
416         public void set_shutdown_any_segwit_required() {
417                 bindings.NodeFeatures_set_shutdown_any_segwit_required(this.ptr);
418                 Reference.reachabilityFence(this);
419         }
420
421         /**
422          * Checks if this feature is supported.
423          */
424         public boolean supports_shutdown_anysegwit() {
425                 boolean ret = bindings.NodeFeatures_supports_shutdown_anysegwit(this.ptr);
426                 Reference.reachabilityFence(this);
427                 return ret;
428         }
429
430         /**
431          * Checks if this feature is required.
432          */
433         public boolean requires_shutdown_anysegwit() {
434                 boolean ret = bindings.NodeFeatures_requires_shutdown_anysegwit(this.ptr);
435                 Reference.reachabilityFence(this);
436                 return ret;
437         }
438
439         /**
440          * Set this feature as optional.
441          */
442         public void set_onion_messages_optional() {
443                 bindings.NodeFeatures_set_onion_messages_optional(this.ptr);
444                 Reference.reachabilityFence(this);
445         }
446
447         /**
448          * Set this feature as required.
449          */
450         public void set_onion_messages_required() {
451                 bindings.NodeFeatures_set_onion_messages_required(this.ptr);
452                 Reference.reachabilityFence(this);
453         }
454
455         /**
456          * Checks if this feature is supported.
457          */
458         public boolean supports_onion_messages() {
459                 boolean ret = bindings.NodeFeatures_supports_onion_messages(this.ptr);
460                 Reference.reachabilityFence(this);
461                 return ret;
462         }
463
464         /**
465          * Checks if this feature is required.
466          */
467         public boolean requires_onion_messages() {
468                 boolean ret = bindings.NodeFeatures_requires_onion_messages(this.ptr);
469                 Reference.reachabilityFence(this);
470                 return ret;
471         }
472
473         /**
474          * Set this feature as optional.
475          */
476         public void set_channel_type_optional() {
477                 bindings.NodeFeatures_set_channel_type_optional(this.ptr);
478                 Reference.reachabilityFence(this);
479         }
480
481         /**
482          * Set this feature as required.
483          */
484         public void set_channel_type_required() {
485                 bindings.NodeFeatures_set_channel_type_required(this.ptr);
486                 Reference.reachabilityFence(this);
487         }
488
489         /**
490          * Checks if this feature is supported.
491          */
492         public boolean supports_channel_type() {
493                 boolean ret = bindings.NodeFeatures_supports_channel_type(this.ptr);
494                 Reference.reachabilityFence(this);
495                 return ret;
496         }
497
498         /**
499          * Checks if this feature is required.
500          */
501         public boolean requires_channel_type() {
502                 boolean ret = bindings.NodeFeatures_requires_channel_type(this.ptr);
503                 Reference.reachabilityFence(this);
504                 return ret;
505         }
506
507         /**
508          * Set this feature as optional.
509          */
510         public void set_scid_privacy_optional() {
511                 bindings.NodeFeatures_set_scid_privacy_optional(this.ptr);
512                 Reference.reachabilityFence(this);
513         }
514
515         /**
516          * Set this feature as required.
517          */
518         public void set_scid_privacy_required() {
519                 bindings.NodeFeatures_set_scid_privacy_required(this.ptr);
520                 Reference.reachabilityFence(this);
521         }
522
523         /**
524          * Checks if this feature is supported.
525          */
526         public boolean supports_scid_privacy() {
527                 boolean ret = bindings.NodeFeatures_supports_scid_privacy(this.ptr);
528                 Reference.reachabilityFence(this);
529                 return ret;
530         }
531
532         /**
533          * Checks if this feature is required.
534          */
535         public boolean requires_scid_privacy() {
536                 boolean ret = bindings.NodeFeatures_requires_scid_privacy(this.ptr);
537                 Reference.reachabilityFence(this);
538                 return ret;
539         }
540
541         /**
542          * Set this feature as optional.
543          */
544         public void set_zero_conf_optional() {
545                 bindings.NodeFeatures_set_zero_conf_optional(this.ptr);
546                 Reference.reachabilityFence(this);
547         }
548
549         /**
550          * Set this feature as required.
551          */
552         public void set_zero_conf_required() {
553                 bindings.NodeFeatures_set_zero_conf_required(this.ptr);
554                 Reference.reachabilityFence(this);
555         }
556
557         /**
558          * Checks if this feature is supported.
559          */
560         public boolean supports_zero_conf() {
561                 boolean ret = bindings.NodeFeatures_supports_zero_conf(this.ptr);
562                 Reference.reachabilityFence(this);
563                 return ret;
564         }
565
566         /**
567          * Checks if this feature is required.
568          */
569         public boolean requires_zero_conf() {
570                 boolean ret = bindings.NodeFeatures_requires_zero_conf(this.ptr);
571                 Reference.reachabilityFence(this);
572                 return ret;
573         }
574
575         /**
576          * Set this feature as optional.
577          */
578         public void set_keysend_optional() {
579                 bindings.NodeFeatures_set_keysend_optional(this.ptr);
580                 Reference.reachabilityFence(this);
581         }
582
583         /**
584          * Set this feature as required.
585          */
586         public void set_keysend_required() {
587                 bindings.NodeFeatures_set_keysend_required(this.ptr);
588                 Reference.reachabilityFence(this);
589         }
590
591         /**
592          * Checks if this feature is supported.
593          */
594         public boolean supports_keysend() {
595                 boolean ret = bindings.NodeFeatures_supports_keysend(this.ptr);
596                 Reference.reachabilityFence(this);
597                 return ret;
598         }
599
600         /**
601          * Checks if this feature is required.
602          */
603         public boolean requires_keysend() {
604                 boolean ret = bindings.NodeFeatures_requires_keysend(this.ptr);
605                 Reference.reachabilityFence(this);
606                 return ret;
607         }
608
609 }