ae6660a3acf3e704abeb837ff8c63a51bfbda779
[ldk-java] / c_sharp / src / org / ldk / structs / InitFeatures.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * Features used within an `init` message.
11  */
12 public class InitFeatures : CommonBase {
13         internal InitFeatures(object _dummy, long ptr) : base(ptr) { }
14         ~InitFeatures() {
15                 if (ptr != 0) { bindings.InitFeatures_free(ptr); }
16         }
17
18         /**
19          * Checks if two InitFeaturess 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.
22          */
23         public bool eq(org.ldk.structs.InitFeatures b) {
24                 bool ret = bindings.InitFeatures_eq(this.ptr, b == null ? 0 : b.ptr);
25                 GC.KeepAlive(this);
26                 GC.KeepAlive(b);
27                 if (this != null) { this.ptrs_to.AddLast(b); };
28                 return ret;
29         }
30
31         public override bool Equals(object o) {
32                 if (!(o is InitFeatures)) return false;
33                 return this.eq((InitFeatures)o);
34         }
35         internal long clone_ptr() {
36                 long ret = bindings.InitFeatures_clone_ptr(this.ptr);
37                 GC.KeepAlive(this);
38                 return ret;
39         }
40
41         /**
42          * Creates a copy of the InitFeatures
43          */
44         public InitFeatures clone() {
45                 long ret = bindings.InitFeatures_clone(this.ptr);
46                 GC.KeepAlive(this);
47                 if (ret >= 0 && ret <= 4096) { return null; }
48                 org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
49                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
50                 return ret_hu_conv;
51         }
52
53         /**
54          * Create a blank Features with no features set
55          */
56         public static InitFeatures empty() {
57                 long ret = bindings.InitFeatures_empty();
58                 if (ret >= 0 && ret <= 4096) { return null; }
59                 org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
60                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
61                 return ret_hu_conv;
62         }
63
64         /**
65          * Returns true if this `Features` object contains unknown feature flags which are set as
66          * \"required\".
67          */
68         public bool requires_unknown_bits() {
69                 bool ret = bindings.InitFeatures_requires_unknown_bits(this.ptr);
70                 GC.KeepAlive(this);
71                 return ret;
72         }
73
74         /**
75          * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
76          */
77         public byte[] write() {
78                 byte[] ret = bindings.InitFeatures_write(this.ptr);
79                 GC.KeepAlive(this);
80                 return ret;
81         }
82
83         /**
84          * Read a InitFeatures from a byte array, created by InitFeatures_write
85          */
86         public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
87                 long ret = bindings.InitFeatures_read(ser);
88                 GC.KeepAlive(ser);
89                 if (ret >= 0 && ret <= 4096) { return null; }
90                 Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
91                 return ret_hu_conv;
92         }
93
94         /**
95          * Set this feature as optional.
96          */
97         public void set_data_loss_protect_optional() {
98                 bindings.InitFeatures_set_data_loss_protect_optional(this.ptr);
99                 GC.KeepAlive(this);
100         }
101
102         /**
103          * Set this feature as required.
104          */
105         public void set_data_loss_protect_required() {
106                 bindings.InitFeatures_set_data_loss_protect_required(this.ptr);
107                 GC.KeepAlive(this);
108         }
109
110         /**
111          * Checks if this feature is supported.
112          */
113         public bool supports_data_loss_protect() {
114                 bool ret = bindings.InitFeatures_supports_data_loss_protect(this.ptr);
115                 GC.KeepAlive(this);
116                 return ret;
117         }
118
119         /**
120          * Checks if this feature is required.
121          */
122         public bool requires_data_loss_protect() {
123                 bool ret = bindings.InitFeatures_requires_data_loss_protect(this.ptr);
124                 GC.KeepAlive(this);
125                 return ret;
126         }
127
128         /**
129          * Set this feature as optional.
130          */
131         public void set_initial_routing_sync_optional() {
132                 bindings.InitFeatures_set_initial_routing_sync_optional(this.ptr);
133                 GC.KeepAlive(this);
134         }
135
136         /**
137          * Set this feature as required.
138          */
139         public void set_initial_routing_sync_required() {
140                 bindings.InitFeatures_set_initial_routing_sync_required(this.ptr);
141                 GC.KeepAlive(this);
142         }
143
144         /**
145          * Checks if this feature is supported.
146          */
147         public bool initial_routing_sync() {
148                 bool ret = bindings.InitFeatures_initial_routing_sync(this.ptr);
149                 GC.KeepAlive(this);
150                 return ret;
151         }
152
153         /**
154          * Set this feature as optional.
155          */
156         public void set_upfront_shutdown_script_optional() {
157                 bindings.InitFeatures_set_upfront_shutdown_script_optional(this.ptr);
158                 GC.KeepAlive(this);
159         }
160
161         /**
162          * Set this feature as required.
163          */
164         public void set_upfront_shutdown_script_required() {
165                 bindings.InitFeatures_set_upfront_shutdown_script_required(this.ptr);
166                 GC.KeepAlive(this);
167         }
168
169         /**
170          * Checks if this feature is supported.
171          */
172         public bool supports_upfront_shutdown_script() {
173                 bool ret = bindings.InitFeatures_supports_upfront_shutdown_script(this.ptr);
174                 GC.KeepAlive(this);
175                 return ret;
176         }
177
178         /**
179          * Checks if this feature is required.
180          */
181         public bool requires_upfront_shutdown_script() {
182                 bool ret = bindings.InitFeatures_requires_upfront_shutdown_script(this.ptr);
183                 GC.KeepAlive(this);
184                 return ret;
185         }
186
187         /**
188          * Set this feature as optional.
189          */
190         public void set_gossip_queries_optional() {
191                 bindings.InitFeatures_set_gossip_queries_optional(this.ptr);
192                 GC.KeepAlive(this);
193         }
194
195         /**
196          * Set this feature as required.
197          */
198         public void set_gossip_queries_required() {
199                 bindings.InitFeatures_set_gossip_queries_required(this.ptr);
200                 GC.KeepAlive(this);
201         }
202
203         /**
204          * Checks if this feature is supported.
205          */
206         public bool supports_gossip_queries() {
207                 bool ret = bindings.InitFeatures_supports_gossip_queries(this.ptr);
208                 GC.KeepAlive(this);
209                 return ret;
210         }
211
212         /**
213          * Checks if this feature is required.
214          */
215         public bool requires_gossip_queries() {
216                 bool ret = bindings.InitFeatures_requires_gossip_queries(this.ptr);
217                 GC.KeepAlive(this);
218                 return ret;
219         }
220
221         /**
222          * Set this feature as optional.
223          */
224         public void set_variable_length_onion_optional() {
225                 bindings.InitFeatures_set_variable_length_onion_optional(this.ptr);
226                 GC.KeepAlive(this);
227         }
228
229         /**
230          * Set this feature as required.
231          */
232         public void set_variable_length_onion_required() {
233                 bindings.InitFeatures_set_variable_length_onion_required(this.ptr);
234                 GC.KeepAlive(this);
235         }
236
237         /**
238          * Checks if this feature is supported.
239          */
240         public bool supports_variable_length_onion() {
241                 bool ret = bindings.InitFeatures_supports_variable_length_onion(this.ptr);
242                 GC.KeepAlive(this);
243                 return ret;
244         }
245
246         /**
247          * Checks if this feature is required.
248          */
249         public bool requires_variable_length_onion() {
250                 bool ret = bindings.InitFeatures_requires_variable_length_onion(this.ptr);
251                 GC.KeepAlive(this);
252                 return ret;
253         }
254
255         /**
256          * Set this feature as optional.
257          */
258         public void set_static_remote_key_optional() {
259                 bindings.InitFeatures_set_static_remote_key_optional(this.ptr);
260                 GC.KeepAlive(this);
261         }
262
263         /**
264          * Set this feature as required.
265          */
266         public void set_static_remote_key_required() {
267                 bindings.InitFeatures_set_static_remote_key_required(this.ptr);
268                 GC.KeepAlive(this);
269         }
270
271         /**
272          * Checks if this feature is supported.
273          */
274         public bool supports_static_remote_key() {
275                 bool ret = bindings.InitFeatures_supports_static_remote_key(this.ptr);
276                 GC.KeepAlive(this);
277                 return ret;
278         }
279
280         /**
281          * Checks if this feature is required.
282          */
283         public bool requires_static_remote_key() {
284                 bool ret = bindings.InitFeatures_requires_static_remote_key(this.ptr);
285                 GC.KeepAlive(this);
286                 return ret;
287         }
288
289         /**
290          * Set this feature as optional.
291          */
292         public void set_payment_secret_optional() {
293                 bindings.InitFeatures_set_payment_secret_optional(this.ptr);
294                 GC.KeepAlive(this);
295         }
296
297         /**
298          * Set this feature as required.
299          */
300         public void set_payment_secret_required() {
301                 bindings.InitFeatures_set_payment_secret_required(this.ptr);
302                 GC.KeepAlive(this);
303         }
304
305         /**
306          * Checks if this feature is supported.
307          */
308         public bool supports_payment_secret() {
309                 bool ret = bindings.InitFeatures_supports_payment_secret(this.ptr);
310                 GC.KeepAlive(this);
311                 return ret;
312         }
313
314         /**
315          * Checks if this feature is required.
316          */
317         public bool requires_payment_secret() {
318                 bool ret = bindings.InitFeatures_requires_payment_secret(this.ptr);
319                 GC.KeepAlive(this);
320                 return ret;
321         }
322
323         /**
324          * Set this feature as optional.
325          */
326         public void set_basic_mpp_optional() {
327                 bindings.InitFeatures_set_basic_mpp_optional(this.ptr);
328                 GC.KeepAlive(this);
329         }
330
331         /**
332          * Set this feature as required.
333          */
334         public void set_basic_mpp_required() {
335                 bindings.InitFeatures_set_basic_mpp_required(this.ptr);
336                 GC.KeepAlive(this);
337         }
338
339         /**
340          * Checks if this feature is supported.
341          */
342         public bool supports_basic_mpp() {
343                 bool ret = bindings.InitFeatures_supports_basic_mpp(this.ptr);
344                 GC.KeepAlive(this);
345                 return ret;
346         }
347
348         /**
349          * Checks if this feature is required.
350          */
351         public bool requires_basic_mpp() {
352                 bool ret = bindings.InitFeatures_requires_basic_mpp(this.ptr);
353                 GC.KeepAlive(this);
354                 return ret;
355         }
356
357         /**
358          * Set this feature as optional.
359          */
360         public void set_wumbo_optional() {
361                 bindings.InitFeatures_set_wumbo_optional(this.ptr);
362                 GC.KeepAlive(this);
363         }
364
365         /**
366          * Set this feature as required.
367          */
368         public void set_wumbo_required() {
369                 bindings.InitFeatures_set_wumbo_required(this.ptr);
370                 GC.KeepAlive(this);
371         }
372
373         /**
374          * Checks if this feature is supported.
375          */
376         public bool supports_wumbo() {
377                 bool ret = bindings.InitFeatures_supports_wumbo(this.ptr);
378                 GC.KeepAlive(this);
379                 return ret;
380         }
381
382         /**
383          * Checks if this feature is required.
384          */
385         public bool requires_wumbo() {
386                 bool ret = bindings.InitFeatures_requires_wumbo(this.ptr);
387                 GC.KeepAlive(this);
388                 return ret;
389         }
390
391         /**
392          * Set this feature as optional.
393          */
394         public void set_shutdown_any_segwit_optional() {
395                 bindings.InitFeatures_set_shutdown_any_segwit_optional(this.ptr);
396                 GC.KeepAlive(this);
397         }
398
399         /**
400          * Set this feature as required.
401          */
402         public void set_shutdown_any_segwit_required() {
403                 bindings.InitFeatures_set_shutdown_any_segwit_required(this.ptr);
404                 GC.KeepAlive(this);
405         }
406
407         /**
408          * Checks if this feature is supported.
409          */
410         public bool supports_shutdown_anysegwit() {
411                 bool ret = bindings.InitFeatures_supports_shutdown_anysegwit(this.ptr);
412                 GC.KeepAlive(this);
413                 return ret;
414         }
415
416         /**
417          * Checks if this feature is required.
418          */
419         public bool requires_shutdown_anysegwit() {
420                 bool ret = bindings.InitFeatures_requires_shutdown_anysegwit(this.ptr);
421                 GC.KeepAlive(this);
422                 return ret;
423         }
424
425         /**
426          * Set this feature as optional.
427          */
428         public void set_onion_messages_optional() {
429                 bindings.InitFeatures_set_onion_messages_optional(this.ptr);
430                 GC.KeepAlive(this);
431         }
432
433         /**
434          * Set this feature as required.
435          */
436         public void set_onion_messages_required() {
437                 bindings.InitFeatures_set_onion_messages_required(this.ptr);
438                 GC.KeepAlive(this);
439         }
440
441         /**
442          * Checks if this feature is supported.
443          */
444         public bool supports_onion_messages() {
445                 bool ret = bindings.InitFeatures_supports_onion_messages(this.ptr);
446                 GC.KeepAlive(this);
447                 return ret;
448         }
449
450         /**
451          * Checks if this feature is required.
452          */
453         public bool requires_onion_messages() {
454                 bool ret = bindings.InitFeatures_requires_onion_messages(this.ptr);
455                 GC.KeepAlive(this);
456                 return ret;
457         }
458
459         /**
460          * Set this feature as optional.
461          */
462         public void set_channel_type_optional() {
463                 bindings.InitFeatures_set_channel_type_optional(this.ptr);
464                 GC.KeepAlive(this);
465         }
466
467         /**
468          * Set this feature as required.
469          */
470         public void set_channel_type_required() {
471                 bindings.InitFeatures_set_channel_type_required(this.ptr);
472                 GC.KeepAlive(this);
473         }
474
475         /**
476          * Checks if this feature is supported.
477          */
478         public bool supports_channel_type() {
479                 bool ret = bindings.InitFeatures_supports_channel_type(this.ptr);
480                 GC.KeepAlive(this);
481                 return ret;
482         }
483
484         /**
485          * Checks if this feature is required.
486          */
487         public bool requires_channel_type() {
488                 bool ret = bindings.InitFeatures_requires_channel_type(this.ptr);
489                 GC.KeepAlive(this);
490                 return ret;
491         }
492
493         /**
494          * Set this feature as optional.
495          */
496         public void set_scid_privacy_optional() {
497                 bindings.InitFeatures_set_scid_privacy_optional(this.ptr);
498                 GC.KeepAlive(this);
499         }
500
501         /**
502          * Set this feature as required.
503          */
504         public void set_scid_privacy_required() {
505                 bindings.InitFeatures_set_scid_privacy_required(this.ptr);
506                 GC.KeepAlive(this);
507         }
508
509         /**
510          * Checks if this feature is supported.
511          */
512         public bool supports_scid_privacy() {
513                 bool ret = bindings.InitFeatures_supports_scid_privacy(this.ptr);
514                 GC.KeepAlive(this);
515                 return ret;
516         }
517
518         /**
519          * Checks if this feature is required.
520          */
521         public bool requires_scid_privacy() {
522                 bool ret = bindings.InitFeatures_requires_scid_privacy(this.ptr);
523                 GC.KeepAlive(this);
524                 return ret;
525         }
526
527         /**
528          * Set this feature as optional.
529          */
530         public void set_zero_conf_optional() {
531                 bindings.InitFeatures_set_zero_conf_optional(this.ptr);
532                 GC.KeepAlive(this);
533         }
534
535         /**
536          * Set this feature as required.
537          */
538         public void set_zero_conf_required() {
539                 bindings.InitFeatures_set_zero_conf_required(this.ptr);
540                 GC.KeepAlive(this);
541         }
542
543         /**
544          * Checks if this feature is supported.
545          */
546         public bool supports_zero_conf() {
547                 bool ret = bindings.InitFeatures_supports_zero_conf(this.ptr);
548                 GC.KeepAlive(this);
549                 return ret;
550         }
551
552         /**
553          * Checks if this feature is required.
554          */
555         public bool requires_zero_conf() {
556                 bool ret = bindings.InitFeatures_requires_zero_conf(this.ptr);
557                 GC.KeepAlive(this);
558                 return ret;
559         }
560
561 }
562 } } }