- public void set_contents(NodeAnnouncement this_ptr, UnsignedNodeAnnouncement val) {
- bindings.NodeAnnouncement_set_contents(this_ptr.ptr & ~1, val.ptr & ~1);
- this.ptrs_to.add(this_ptr);
- this.ptrs_to.add(val);
+ /**
+ * Constructs a new NodeAnnouncement given each field
+ */
+ public static NodeAnnouncement of(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) {
+ long ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
+ 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(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a copy of the NodeAnnouncement
+ */
+ public NodeAnnouncement clone() {
+ long ret = bindings.NodeAnnouncement_clone(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;
+ }
+
+ /**
+ * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.NodeAnnouncement_write(this.ptr);
+ return ret;