Bindings updates
[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 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);
21                 return ret_hu_conv;
22         }
23
24         public void set_channels(long[] val) {
25                 bindings.NodeInfo_set_channels(this.ptr, val);
26         }
27
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);
32                 return ret_hu_conv;
33         }
34
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);
38         }
39
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);
44                 return ret_hu_conv;
45         }
46
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);
50         }
51
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);
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 }