Update to support None
[ldk-java] / src / main / java / org / ldk / structs / NodeAnnouncement.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class NodeAnnouncement extends CommonBase {
7         NodeAnnouncement(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 bindings.NodeAnnouncement_free(ptr); super.finalize();
11         }
12
13         public NodeAnnouncement(NodeAnnouncement orig) {
14                 super(bindings.NodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1));
15                 this.ptrs_to.add(orig);
16         }
17
18         public byte[] get_signature(NodeAnnouncement this_ptr) {
19                 byte[] ret = bindings.NodeAnnouncement_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1);
20                 this.ptrs_to.add(this_ptr);
21                 return ret;
22         }
23
24         public void set_signature(NodeAnnouncement this_ptr, byte[] val) {
25                 bindings.NodeAnnouncement_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
26                 this.ptrs_to.add(this_ptr);
27         }
28
29         public UnsignedNodeAnnouncement get_contents(NodeAnnouncement this_ptr) {
30                 UnsignedNodeAnnouncement ret = new UnsignedNodeAnnouncement(null, bindings.NodeAnnouncement_get_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1));
31                 this.ptrs_to.add(this_ptr);
32                 return ret;
33         }
34
35         public void set_contents(NodeAnnouncement this_ptr, UnsignedNodeAnnouncement val) {
36                 bindings.NodeAnnouncement_set_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
37                 this.ptrs_to.add(this_ptr);
38                 this.ptrs_to.add(val);
39         }
40
41         public NodeAnnouncement(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) {
42                 super(bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1));
43                 this.ptrs_to.add(contents_arg);
44         }
45
46         // Skipped NodeAnnouncement_write
47         public NodeAnnouncement(byte[] ser) {
48                 super(bindings.NodeAnnouncement_read(ser));
49         }
50
51 }