b180a5091a018f7dc18978bde59d3df8ad1b8b57
[ldk-java] / src / main / java / org / ldk / structs / NodeAnnouncementInfo.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class NodeAnnouncementInfo extends CommonBase {
10         NodeAnnouncementInfo(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.NodeAnnouncementInfo_free(ptr); }
15         }
16
17         public NodeFeatures get_features() {
18                 long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr);
19                 NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
20                 return ret_hu_conv;
21         }
22
23         // Skipped NodeAnnouncementInfo_set_features
24         public int get_last_update() {
25                 int ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr);
26                 return ret;
27         }
28
29         public void set_last_update(int val) {
30                 bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val);
31         }
32
33         public byte[] get_rgb() {
34                 byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr);
35                 return ret;
36         }
37
38         public void set_rgb(byte[] val) {
39                 bindings.NodeAnnouncementInfo_set_rgb(this.ptr, val);
40         }
41
42         public byte[] get_alias() {
43                 byte[] ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr);
44                 return ret;
45         }
46
47         public void set_alias(byte[] val) {
48                 bindings.NodeAnnouncementInfo_set_alias(this.ptr, val);
49         }
50
51         public void set_addresses(NetAddress[] val) {
52                 bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray());
53                 /* TODO 2 NetAddress  */;
54         }
55
56         public NodeAnnouncement get_announcement_message() {
57                 long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr);
58                 NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret);
59                 return ret_hu_conv;
60         }
61
62         public void set_announcement_message(NodeAnnouncement val) {
63                 bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
64                 this.ptrs_to.add(val);
65         }
66
67         // Skipped NodeAnnouncementInfo_new
68         public byte[] write(NodeAnnouncementInfo obj) {
69                 byte[] ret = bindings.NodeAnnouncementInfo_write(obj == null ? 0 : obj.ptr & ~1);
70                 this.ptrs_to.add(obj);
71                 return ret;
72         }
73
74         public static NodeAnnouncementInfo constructor_read(byte[] ser) {
75                 long ret = bindings.NodeAnnouncementInfo_read(ser);
76                 NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
77                 return ret_hu_conv;
78         }
79
80 }