Update to support None
[ldk-java] / src / main / java / org / ldk / structs / UnsignedChannelUpdate.java
index 9147908830e7ae9bfd7773e6d7e7411948c0852f..f56cca90d569a01000236546e098cbf054224e15 100644 (file)
@@ -11,95 +11,95 @@ public class UnsignedChannelUpdate extends CommonBase {
        }
 
        public UnsignedChannelUpdate(UnsignedChannelUpdate orig) {
-               super(bindings.UnsignedChannelUpdate_clone(orig.ptr & ~1));
+               super(bindings.UnsignedChannelUpdate_clone(orig == null ? 0 : orig.ptr & ~1));
                this.ptrs_to.add(orig);
        }
 
        public byte[] get_chain_hash(UnsignedChannelUpdate this_ptr) {
-               byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this_ptr.ptr & ~1);
+               byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_chain_hash(UnsignedChannelUpdate this_ptr, byte[] val) {
-               bindings.UnsignedChannelUpdate_set_chain_hash(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public long get_short_channel_id(UnsignedChannelUpdate this_ptr) {
-               long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this_ptr.ptr & ~1);
+               long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_short_channel_id(UnsignedChannelUpdate this_ptr, long val) {
-               bindings.UnsignedChannelUpdate_set_short_channel_id(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public int get_timestamp(UnsignedChannelUpdate this_ptr) {
-               int ret = bindings.UnsignedChannelUpdate_get_timestamp(this_ptr.ptr & ~1);
+               int ret = bindings.UnsignedChannelUpdate_get_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_timestamp(UnsignedChannelUpdate this_ptr, int val) {
-               bindings.UnsignedChannelUpdate_set_timestamp(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public byte get_flags(UnsignedChannelUpdate this_ptr) {
-               byte ret = bindings.UnsignedChannelUpdate_get_flags(this_ptr.ptr & ~1);
+               byte ret = bindings.UnsignedChannelUpdate_get_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_flags(UnsignedChannelUpdate this_ptr, byte val) {
-               bindings.UnsignedChannelUpdate_set_flags(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public short get_cltv_expiry_delta(UnsignedChannelUpdate this_ptr) {
-               short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr.ptr & ~1);
+               short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_cltv_expiry_delta(UnsignedChannelUpdate this_ptr, short val) {
-               bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public long get_htlc_minimum_msat(UnsignedChannelUpdate this_ptr) {
-               long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr.ptr & ~1);
+               long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_htlc_minimum_msat(UnsignedChannelUpdate this_ptr, long val) {
-               bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public int get_fee_base_msat(UnsignedChannelUpdate this_ptr) {
-               int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this_ptr.ptr & ~1);
+               int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_fee_base_msat(UnsignedChannelUpdate this_ptr, int val) {
-               bindings.UnsignedChannelUpdate_set_fee_base_msat(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_fee_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }
 
        public int get_fee_proportional_millionths(UnsignedChannelUpdate this_ptr) {
-               int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr.ptr & ~1);
+               int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
                return ret;
        }
 
        public void set_fee_proportional_millionths(UnsignedChannelUpdate this_ptr, int val) {
-               bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr.ptr & ~1, val);
+               bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
                this.ptrs_to.add(this_ptr);
        }