1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class NodeInfo extends CommonBase {
10 NodeInfo(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.NodeInfo_free(ptr); }
17 public NodeInfo clone() {
18 long ret = bindings.NodeInfo_clone(this.ptr);
19 NodeInfo ret_hu_conv = new NodeInfo(null, ret);
20 ret_hu_conv.ptrs_to.add(this);
24 public void set_channels(long[] val) {
25 bindings.NodeInfo_set_channels(this.ptr, val);
28 public RoutingFees get_lowest_inbound_channel_fees() {
29 long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr);
30 RoutingFees ret_hu_conv = new RoutingFees(null, ret);
31 ret_hu_conv.ptrs_to.add(this);
35 public void set_lowest_inbound_channel_fees(RoutingFees val) {
36 bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
37 this.ptrs_to.add(val);
40 public NodeAnnouncementInfo get_announcement_info() {
41 long ret = bindings.NodeInfo_get_announcement_info(this.ptr);
42 NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
43 ret_hu_conv.ptrs_to.add(this);
47 public void set_announcement_info(NodeAnnouncementInfo val) {
48 bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1);
49 this.ptrs_to.add(val);
52 public static NodeInfo constructor_new(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) {
53 long ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, announcement_info_arg == null ? 0 : announcement_info_arg.ptr & ~1);
54 NodeInfo ret_hu_conv = new NodeInfo(null, ret);
55 ret_hu_conv.ptrs_to.add(ret_hu_conv);
56 ret_hu_conv.ptrs_to.add(lowest_inbound_channel_fees_arg);
57 ret_hu_conv.ptrs_to.add(announcement_info_arg);
61 public byte[] write() {
62 byte[] ret = bindings.NodeInfo_write(this.ptr);
66 public static Result_NodeInfoDecodeErrorZ constructor_read(byte[] ser) {
67 long ret = bindings.NodeInfo_read(ser);
68 Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);