Update to support None
[ldk-java] / src / main / java / org / ldk / structs / ChannelAnnouncement.java
index 1c68067027638131088139e2294cf94e51dc2b98..69c573d8af3a2675de81fb8408526c8483f7962e 100644 (file)
@@ -11,68 +11,68 @@ public class ChannelAnnouncement extends CommonBase {
        }
 
        public ChannelAnnouncement(ChannelAnnouncement orig) {
-               super(bindings.ChannelAnnouncement_clone(orig.ptr & ~1));
+               super(bindings.ChannelAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_node_signature_1(ChannelAnnouncement this_ptr) {
-               byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_node_signature_1(ChannelAnnouncement this_ptr, byte[] val) {
-               bindings.ChannelAnnouncement_set_node_signature_1(this_ptr.ptr & ~1, val);
+               bindings.ChannelAnnouncement_set_node_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_node_signature_2(ChannelAnnouncement this_ptr) {
-               byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_node_signature_2(ChannelAnnouncement this_ptr, byte[] val) {
-               bindings.ChannelAnnouncement_set_node_signature_2(this_ptr.ptr & ~1, val);
+               bindings.ChannelAnnouncement_set_node_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_bitcoin_signature_1(ChannelAnnouncement this_ptr) {
-               byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_bitcoin_signature_1(ChannelAnnouncement this_ptr, byte[] val) {
-               bindings.ChannelAnnouncement_set_bitcoin_signature_1(this_ptr.ptr & ~1, val);
+               bindings.ChannelAnnouncement_set_bitcoin_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte[] get_bitcoin_signature_2(ChannelAnnouncement this_ptr) {
-               byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this_ptr.ptr & ~1);
+               byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_bitcoin_signature_2(ChannelAnnouncement this_ptr, byte[] val) {
-               bindings.ChannelAnnouncement_set_bitcoin_signature_2(this_ptr.ptr & ~1, val);
+               bindings.ChannelAnnouncement_set_bitcoin_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public UnsignedChannelAnnouncement get_contents(ChannelAnnouncement this_ptr) {
-               UnsignedChannelAnnouncement ret = new UnsignedChannelAnnouncement(null, bindings.ChannelAnnouncement_get_contents(this_ptr.ptr & ~1));
+               UnsignedChannelAnnouncement ret = new UnsignedChannelAnnouncement(null, bindings.ChannelAnnouncement_get_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1));
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_contents(ChannelAnnouncement this_ptr, UnsignedChannelAnnouncement val) {
-               bindings.ChannelAnnouncement_set_contents(this_ptr.ptr & ~1, val.ptr & ~1);
+               bindings.ChannelAnnouncement_set_contents(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 ChannelAnnouncement(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) {
-               super(bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg.ptr & ~1));
+               super(bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1));
                this.ptrs_to.add(contents_arg);
        }