1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * Features used within a `node_announcement` message.
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 {
18 if (ptr != 0) { bindings.NodeFeatures_free(ptr); }
22 * Creates a copy of the NodeFeatures
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);
32 * Create a blank Features with no features set
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);
42 * Creates a Features with the bits set which are known by the implementation
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);
52 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
54 public byte[] write() {
55 byte[] ret = bindings.NodeFeatures_write(this.ptr);
60 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
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);