8b9837398d36a2f49bbfb685bf011357ebe09321
[ldk-java] / src / main / java / org / ldk / structs / NodeInfo.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 @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 {
13                 super.finalize();
14                 if (ptr != 0) { bindings.NodeInfo_free(ptr); }
15         }
16
17         public void set_channels(long[] val) {
18                 bindings.NodeInfo_set_channels(this.ptr, val);
19         }
20
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);
25                 return ret_hu_conv;
26         }
27
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);
31         }
32
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);
37                 return ret_hu_conv;
38         }
39
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);
43         }
44
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);
51                 return ret_hu_conv;
52         }
53
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);
58                 return ret_hu_conv;
59         }
60
61         public byte[] write() {
62                 byte[] ret = bindings.NodeInfo_write(this.ptr);
63                 return ret;
64         }
65
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);
69                 return ret_hu_conv;
70         }
71
72 }