Update auto-generated 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
8
9 /**
10  * Features used within a `node_announcement` message.
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class NodeFeatures extends CommonBase {
14         NodeFeatures(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.NodeFeatures_free(ptr); }
19         }
20
21         /**
22          * Creates a copy of the NodeFeatures
23          */
24         public NodeFeatures clone() {
25                 long ret = bindings.NodeFeatures_clone(this.ptr);
26                 NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
27                 ret_hu_conv.ptrs_to.add(this);
28                 return ret_hu_conv;
29         }
30
31         /**
32          * Create a blank Features with no features set
33          */
34         public static NodeFeatures constructor_empty() {
35                 long ret = bindings.NodeFeatures_empty();
36                 NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
37                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
38                 return ret_hu_conv;
39         }
40
41         /**
42          * Creates a Features with the bits set which are known by the implementation
43          */
44         public static NodeFeatures constructor_known() {
45                 long ret = bindings.NodeFeatures_known();
46                 NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
47                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
48                 return ret_hu_conv;
49         }
50
51         /**
52          * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
53          */
54         public byte[] write() {
55                 byte[] ret = bindings.NodeFeatures_write(this.ptr);
56                 return ret;
57         }
58
59         /**
60          * Read a NodeFeatures from a byte array, created by NodeFeatures_write
61          */
62         public static Result_NodeFeaturesDecodeErrorZ constructor_read(byte[] ser) {
63                 long ret = bindings.NodeFeatures_read(ser);
64                 Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
65                 return ret_hu_conv;
66         }
67
68 }