Rewrite the world, with several interdependant changes (but several still WIP)
[ldk-java] / src / main / java / org / ldk / structs / Shutdown.java
index 111511269b4244cb8efcb0472ac3f65891ab6b6e..6b95b56863ce9ce1d730003780e749b4d808d5cc 100644 (file)
@@ -2,7 +2,10 @@ package org.ldk.structs;
 
 import org.ldk.impl.bindings;
 import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
 
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class Shutdown extends CommonBase {
        Shutdown(Object _dummy, long ptr) { super(ptr); }
        @Override @SuppressWarnings("deprecation")
@@ -11,35 +14,35 @@ public class Shutdown extends CommonBase {
                bindings.Shutdown_free(ptr);
        }
 
-       public Shutdown(Shutdown orig) {
-               super(bindings.Shutdown_clone(orig == null ? 0 : orig.ptr & ~1));
-               this.ptrs_to.add(orig);
+       public static Shutdown constructor_clone(Shutdown orig) {
+               long ret = bindings.Shutdown_clone(orig == null ? 0 : orig.ptr & ~1);
+               Shutdown ret_hu_conv = new Shutdown(null, ret);
+               ret_hu_conv.ptrs_to.add(orig);
+               return ret_hu_conv;
        }
 
-       public byte[] get_channel_id(Shutdown this_ptr) {
-               byte[] ret = bindings.Shutdown_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
+       public byte[] get_channel_id() {
+               byte[] ret = bindings.Shutdown_get_channel_id(this.ptr);
                return ret;
        }
 
-       public void set_channel_id(Shutdown this_ptr, byte[] val) {
-               bindings.Shutdown_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
-               this.ptrs_to.add(this_ptr);
+       public void set_channel_id(byte[] val) {
+               bindings.Shutdown_set_channel_id(this.ptr, val);
        }
 
-       public byte[] get_scriptpubkey(Shutdown this_ptr) {
-               byte[] ret = bindings.Shutdown_get_scriptpubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
+       public byte[] get_scriptpubkey() {
+               byte[] ret = bindings.Shutdown_get_scriptpubkey(this.ptr);
                return ret;
        }
 
-       public void set_scriptpubkey(Shutdown this_ptr, byte[] val) {
-               bindings.Shutdown_set_scriptpubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
-               this.ptrs_to.add(this_ptr);
+       public void set_scriptpubkey(byte[] val) {
+               bindings.Shutdown_set_scriptpubkey(this.ptr, val);
        }
 
-       public Shutdown(byte[] channel_id_arg, byte[] scriptpubkey_arg) {
-               super(bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg));
+       public static Shutdown constructor_new(byte[] channel_id_arg, byte[] scriptpubkey_arg) {
+               long ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg);
+               Shutdown ret_hu_conv = new Shutdown(null, ret);
+               return ret_hu_conv;
        }
 
        public byte[] write(Shutdown obj) {
@@ -48,8 +51,10 @@ public class Shutdown extends CommonBase {
                return ret;
        }
 
-       public Shutdown(byte[] ser) {
-               super(bindings.Shutdown_read(ser));
+       public static Shutdown constructor_read(byte[] ser) {
+               long ret = bindings.Shutdown_read(ser);
+               Shutdown ret_hu_conv = new Shutdown(null, ret);
+               return ret_hu_conv;
        }
 
 }