Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / UnsignedNodeAnnouncement.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
9 /**
10  * The unsigned part of a node_announcement
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class UnsignedNodeAnnouncement extends CommonBase {
14         UnsignedNodeAnnouncement(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); }
19         }
20
21         /**
22          * The advertised features
23          */
24         public NodeFeatures get_features() {
25                 long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr);
26                 NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
27                 ret_hu_conv.ptrs_to.add(this);
28                 return ret_hu_conv;
29         }
30
31         /**
32          * The advertised features
33          */
34         public void set_features(NodeFeatures val) {
35                 bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
36                 this.ptrs_to.add(val);
37         }
38
39         /**
40          * A strictly monotonic announcement counter, with gaps allowed
41          */
42         public int get_timestamp() {
43                 int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr);
44                 return ret;
45         }
46
47         /**
48          * A strictly monotonic announcement counter, with gaps allowed
49          */
50         public void set_timestamp(int val) {
51                 bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val);
52         }
53
54         /**
55          * The node_id this announcement originated from (don't rebroadcast the node_announcement back
56          * to this node).
57          */
58         public byte[] get_node_id() {
59                 byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr);
60                 return ret;
61         }
62
63         /**
64          * The node_id this announcement originated from (don't rebroadcast the node_announcement back
65          * to this node).
66          */
67         public void set_node_id(byte[] val) {
68                 bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val);
69         }
70
71         /**
72          * An RGB color for UI purposes
73          */
74         public byte[] get_rgb() {
75                 byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr);
76                 return ret;
77         }
78
79         /**
80          * An RGB color for UI purposes
81          */
82         public void set_rgb(byte[] val) {
83                 bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val);
84         }
85
86         /**
87          * An alias, for UI purposes.  This should be sanitized before use.  There is no guarantee
88          * of uniqueness.
89          */
90         public byte[] get_alias() {
91                 byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr);
92                 return ret;
93         }
94
95         /**
96          * An alias, for UI purposes.  This should be sanitized before use.  There is no guarantee
97          * of uniqueness.
98          */
99         public void set_alias(byte[] val) {
100                 bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val);
101         }
102
103         /**
104          * List of addresses on which this node is reachable
105          */
106         public void set_addresses(NetAddress[] val) {
107                 bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray());
108                 /* TODO 2 NetAddress  */;
109         }
110
111         /**
112          * Creates a copy of the UnsignedNodeAnnouncement
113          */
114         public UnsignedNodeAnnouncement clone() {
115                 long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr);
116                 UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret);
117                 ret_hu_conv.ptrs_to.add(this);
118                 return ret_hu_conv;
119         }
120
121         /**
122          * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
123          */
124         public byte[] write() {
125                 byte[] ret = bindings.UnsignedNodeAnnouncement_write(this.ptr);
126                 return ret;
127         }
128
129         /**
130          * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
131          */
132         public static Result_UnsignedNodeAnnouncementDecodeErrorZ read(byte[] ser) {
133                 long ret = bindings.UnsignedNodeAnnouncement_read(ser);
134                 Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
135                 return ret_hu_conv;
136         }
137
138 }