- // Skipped NodeInfo_set_announcement_info
- // Skipped NodeInfo_new
- public byte[] write(NodeInfo obj) {
- byte[] ret = bindings.NodeInfo_write(obj == null ? 0 : obj.ptr & ~1);
- this.ptrs_to.add(obj);
+ /**
+ * More information about a node from node_announcement.
+ * Optional because we store a Node entry after learning about it from
+ * a channel announcement, but before receiving a node announcement.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public void set_announcement_info(@Nullable NodeAnnouncementInfo val) {
+ bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1);
+ this.ptrs_to.add(val);
+ }
+
+ /**
+ * Constructs a new NodeInfo given each field
+ */
+ public static NodeInfo of(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) {
+ 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);
+ if (ret < 1024) { return null; }
+ NodeInfo ret_hu_conv = new NodeInfo(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(lowest_inbound_channel_fees_arg);
+ ret_hu_conv.ptrs_to.add(announcement_info_arg);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a copy of the NodeInfo
+ */
+ public NodeInfo clone() {
+ long ret = bindings.NodeInfo_clone(this.ptr);
+ if (ret < 1024) { return null; }
+ NodeInfo ret_hu_conv = new NodeInfo(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.NodeInfo_write(this.ptr);