- // Skipped NodeInfo_new
- // Skipped NodeInfo_write
- public NodeInfo(byte[] ser) {
- super(bindings.NodeInfo_read(ser));
+ /**
+ * 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);
+ return ret;
+ }
+
+ /**
+ * Read a NodeInfo from a byte array, created by NodeInfo_write
+ */
+ public static Result_NodeInfoDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.NodeInfo_read(ser);
+ if (ret < 1024) { return null; }
+ Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;