]> git.bitcoin.ninja Git - ldk-java/blobdiff - src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java
explode to constructor args when we cant clone but need to
[ldk-java] / src / main / java / org / ldk / structs / UnsignedNodeAnnouncement.java
index f36b5f1f4050d0edff37e361c3f74917f2e89dfb..3a20d82091d4118f0690b0b9e23b85fcd3df4e1c 100644 (file)
@@ -11,63 +11,65 @@ public class UnsignedNodeAnnouncement extends CommonBase {
        }
 
        public UnsignedNodeAnnouncement(UnsignedNodeAnnouncement orig) {
-               super(bindings.UnsignedNodeAnnouncement_clone(orig.ptr & ~1));
+               super(bindings.UnsignedNodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public NodeFeatures get_features(UnsignedNodeAnnouncement this_ptr) {
-               NodeFeatures ret = new NodeFeatures(null, bindings.UnsignedNodeAnnouncement_get_features(this_ptr.ptr & ~1));
+               NodeFeatures ret = new NodeFeatures(null, bindings.UnsignedNodeAnnouncement_get_features(this_ptr == null ? 0 : this_ptr.ptr & ~1));
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
-       public void set_features(UnsignedNodeAnnouncement this_ptr, NodeFeatures val) {
-               bindings.UnsignedNodeAnnouncement_set_features(this_ptr.ptr & ~1, val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped UnsignedNodeAnnouncement_set_features
        public int get_timestamp(UnsignedNodeAnnouncement this_ptr) {
-               int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this_ptr.ptr & ~1);
+               int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_timestamp(UnsignedNodeAnnouncement this_ptr, int val) {
-               bindings.UnsignedNodeAnnouncement_set_timestamp(this_ptr.ptr & ~1, val);
+               bindings.UnsignedNodeAnnouncement_set_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_node_id(UnsignedNodeAnnouncement this_ptr) {
-               byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this_ptr.ptr & ~1);
+               byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_node_id(UnsignedNodeAnnouncement this_ptr, byte[] val) {
-               bindings.UnsignedNodeAnnouncement_set_node_id(this_ptr.ptr & ~1, val);
+               bindings.UnsignedNodeAnnouncement_set_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_rgb(UnsignedNodeAnnouncement this_ptr) {
-               byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this_ptr.ptr & ~1);
+               byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
-       // Skipped UnsignedNodeAnnouncement_set_rgb
+       public void set_rgb(UnsignedNodeAnnouncement this_ptr, byte[] val) {
+               bindings.UnsignedNodeAnnouncement_set_rgb(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
+               this.ptrs_to.add(this_ptr);
+       }
+
        public byte[] get_alias(UnsignedNodeAnnouncement this_ptr) {
-               byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this_ptr.ptr & ~1);
+               byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_alias(UnsignedNodeAnnouncement this_ptr, byte[] val) {
-               bindings.UnsignedNodeAnnouncement_set_alias(this_ptr.ptr & ~1, val);
+               bindings.UnsignedNodeAnnouncement_set_alias(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        // Skipped UnsignedNodeAnnouncement_set_addresses
        // Skipped UnsignedNodeAnnouncement_write
-       // Skipped UnsignedNodeAnnouncement_read
+       public UnsignedNodeAnnouncement(byte[] ser) {
+               super(bindings.UnsignedNodeAnnouncement_read(ser));
+       }
+
 }