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 void set_channels(long[] val) {
18 bindings.NodeInfo_set_channels(this.ptr, val);
21 public RoutingFees get_lowest_inbound_channel_fees() {
22 long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr);
23 RoutingFees ret_hu_conv = new RoutingFees(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_lowest_inbound_channel_fees(RoutingFees val) {
29 bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
30 this.ptrs_to.add(val);
33 public NodeAnnouncementInfo get_announcement_info() {
34 long ret = bindings.NodeInfo_get_announcement_info(this.ptr);
35 NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
36 ret_hu_conv.ptrs_to.add(this);
40 public void set_announcement_info(NodeAnnouncementInfo val) {
41 bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1);
42 this.ptrs_to.add(val);
45 public static NodeInfo constructor_new(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) {
46 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);
47 NodeInfo ret_hu_conv = new NodeInfo(null, ret);
48 ret_hu_conv.ptrs_to.add(ret_hu_conv);
49 ret_hu_conv.ptrs_to.add(lowest_inbound_channel_fees_arg);
50 ret_hu_conv.ptrs_to.add(announcement_info_arg);
54 public NodeInfo clone() {
55 long ret = bindings.NodeInfo_clone(this.ptr);
56 NodeInfo ret_hu_conv = new NodeInfo(null, ret);
57 ret_hu_conv.ptrs_to.add(this);
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);