Update to support None
[ldk-java] / src / main / java / org / ldk / structs / UnsignedNodeAnnouncement.java
index 51d93e3522a8e7d890905d692fe0fa849cb70f41..828432ec2c6685c23c3f020e83ccb3caf7c8954c 100644 (file)
@@ -11,63 +11,63 @@ 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);
+               bindings.UnsignedNodeAnnouncement_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                this.ptrs_to.add(val);
        }
 
        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;
        }
 
        public void set_rgb(UnsignedNodeAnnouncement this_ptr, byte[] val) {
-               bindings.UnsignedNodeAnnouncement_set_rgb(this_ptr.ptr & ~1, 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);
        }