Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / UnsignedNodeAnnouncement.java
index 65559db153b11b26095a92e69506db3cc3c35804..57021d8fda74b8454976c1f3db17d28badb76c3d 100644 (file)
@@ -4,7 +4,12 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
+
+/**
+ * The unsigned part of a node_announcement
+ */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class UnsignedNodeAnnouncement extends CommonBase {
        UnsignedNodeAnnouncement(Object _dummy, long ptr) { super(ptr); }
@@ -14,69 +19,121 @@ public class UnsignedNodeAnnouncement extends CommonBase {
                if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); }
        }
 
-       public static UnsignedNodeAnnouncement constructor_clone(UnsignedNodeAnnouncement orig) {
-               long ret = bindings.UnsignedNodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1);
-               UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret);
-               ret_hu_conv.ptrs_to.add(orig);
-               return ret_hu_conv;
-       }
-
+       /**
+        * The advertised features
+        */
        public NodeFeatures get_features() {
                long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr);
-               NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); }
+               ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
-       // Skipped UnsignedNodeAnnouncement_set_features
+       /**
+        * The advertised features
+        */
+       public void set_features(NodeFeatures val) {
+               bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+       }
+
+       /**
+        * A strictly monotonic announcement counter, with gaps allowed
+        */
        public int get_timestamp() {
                int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr);
                return ret;
        }
 
+       /**
+        * A strictly monotonic announcement counter, with gaps allowed
+        */
        public void set_timestamp(int val) {
                bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val);
        }
 
+       /**
+        * The node_id this announcement originated from (don't rebroadcast the node_announcement back
+        * to this node).
+        */
        public byte[] get_node_id() {
                byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr);
                return ret;
        }
 
+       /**
+        * The node_id this announcement originated from (don't rebroadcast the node_announcement back
+        * to this node).
+        */
        public void set_node_id(byte[] val) {
                bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val);
        }
 
+       /**
+        * An RGB color for UI purposes
+        */
        public byte[] get_rgb() {
                byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr);
                return ret;
        }
 
+       /**
+        * An RGB color for UI purposes
+        */
        public void set_rgb(byte[] val) {
                bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val);
        }
 
+       /**
+        * An alias, for UI purposes.  This should be sanitized before use.  There is no guarantee
+        * of uniqueness.
+        */
        public byte[] get_alias() {
                byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr);
                return ret;
        }
 
+       /**
+        * An alias, for UI purposes.  This should be sanitized before use.  There is no guarantee
+        * of uniqueness.
+        */
        public void set_alias(byte[] val) {
                bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val);
        }
 
+       /**
+        * List of addresses on which this node is reachable
+        */
        public void set_addresses(NetAddress[] val) {
-               bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray());
-               /* TODO 2 NetAddress  */;
+               bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null);
+       }
+
+       /**
+        * Creates a copy of the UnsignedNodeAnnouncement
+        */
+       public UnsignedNodeAnnouncement clone() {
+               long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); }
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
        }
 
+       /**
+        * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
+        */
        public byte[] write() {
                byte[] ret = bindings.UnsignedNodeAnnouncement_write(this.ptr);
                return ret;
        }
 
-       public static UnsignedNodeAnnouncement constructor_read(byte[] ser) {
+       /**
+        * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
+        */
+       public static Result_UnsignedNodeAnnouncementDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UnsignedNodeAnnouncement_read(ser);
-               UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }