3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class NodeAnnouncementInfo extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.NodeAnnouncementInfo_free(this.ptr);
21 public NodeFeatures get_features() {
22 number ret = bindings.NodeAnnouncementInfo_get_features(this.ptr);
23 const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_features(NodeFeatures val) {
29 bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
30 this.ptrs_to.add(val);
33 public number get_last_update() {
34 number ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr);
38 public void set_last_update(number val) {
39 bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val);
42 public Uint8Array get_rgb() {
43 Uint8Array ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr);
47 public void set_rgb(Uint8Array val) {
48 bindings.NodeAnnouncementInfo_set_rgb(this.ptr, val);
51 public Uint8Array get_alias() {
52 Uint8Array ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr);
56 public void set_alias(Uint8Array val) {
57 bindings.NodeAnnouncementInfo_set_alias(this.ptr, val);
60 public void set_addresses(NetAddress[] val) {
61 bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new));
62 /* TODO 2 NetAddress */;
65 public NodeAnnouncement get_announcement_message() {
66 number ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr);
67 const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret);
68 ret_hu_conv.ptrs_to.add(this);
72 public void set_announcement_message(NodeAnnouncement val) {
73 bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
74 this.ptrs_to.add(val);
77 public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, number last_update_arg, Uint8Array rgb_arg, Uint8Array alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
78 number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).map(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(number[]::new), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
79 const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
80 ret_hu_conv.ptrs_to.add(ret_hu_conv);
81 ret_hu_conv.ptrs_to.add(features_arg);
82 /* TODO 2 NetAddress */;
83 ret_hu_conv.ptrs_to.add(announcement_message_arg);
87 public NodeAnnouncementInfo clone() {
88 number ret = bindings.NodeAnnouncementInfo_clone(this.ptr);
89 const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
90 ret_hu_conv.ptrs_to.add(this);
94 public Uint8Array write() {
95 Uint8Array ret = bindings.NodeAnnouncementInfo_write(this.ptr);
99 public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_read(Uint8Array ser) {
100 number ret = bindings.NodeAnnouncementInfo_read(ser);
101 Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);