+ /**
+ * Moniker assigned to the node.
+ * May be invalid or malicious (eg control chars),
+ * should not be exposed to the user.
+ */
+ public void set_alias(byte[] val) {
+ bindings.NodeAnnouncementInfo_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32));
+ }
+
+ /**
+ * Internet-level addresses via which one can connect to the node
+ */
+ public void set_addresses(NetAddress[] val) {
+ bindings.NodeAnnouncementInfo_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null);
+ }
+
+ /**
+ * An initial announcement of the node
+ * Mostly redundant with the data we store in fields explicitly.
+ * Everything else is useful only for sending out for initial routing sync.
+ * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable
+ public NodeAnnouncement get_announcement_message() {
+ long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); }
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * An initial announcement of the node
+ * Mostly redundant with the data we store in fields explicitly.
+ * Everything else is useful only for sending out for initial routing sync.
+ * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public void set_announcement_message(@Nullable NodeAnnouncement val) {
+ bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
+ /**
+ * Constructs a new NodeAnnouncementInfo given each field
+ */
+ public static NodeAnnouncementInfo of(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
+ long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), InternalUtils.check_arr_len(alias_arg, 32), addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray() : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;