Update auto-generated bindings with new upstream.
[ldk-java] / src / main / java / org / ldk / structs / ChannelConfig.java
index ba24fc377e51fb501f73b4c7e90ebda98bf9f2a6..5af68d383c2fefab17e063aa3d816a4202eacb99 100644 (file)
@@ -2,63 +2,75 @@ 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 ChannelConfig extends CommonBase {
        ChannelConfig(Object _dummy, long ptr) { super(ptr); }
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
-               bindings.ChannelConfig_free(ptr); super.finalize();
+               super.finalize();
+               if (ptr != 0) { bindings.ChannelConfig_free(ptr); }
        }
 
-       public ChannelConfig(ChannelConfig orig) {
-               super(bindings.ChannelConfig_clone(orig.ptr & ~1));
-               this.ptrs_to.add(orig);
+       public int get_fee_proportional_millionths() {
+               int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this.ptr);
+               return ret;
+       }
+
+       public void set_fee_proportional_millionths(int val) {
+               bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val);
        }
 
-       public int get_fee_proportional_millionths(ChannelConfig this_ptr) {
-               int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this_ptr.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
+       public boolean get_announced_channel() {
+               boolean ret = bindings.ChannelConfig_get_announced_channel(this.ptr);
                return ret;
        }
 
-       public void set_fee_proportional_millionths(ChannelConfig this_ptr, int val) {
-               bindings.ChannelConfig_set_fee_proportional_millionths(this_ptr.ptr & ~1, val);
-               this.ptrs_to.add(this_ptr);
+       public void set_announced_channel(boolean val) {
+               bindings.ChannelConfig_set_announced_channel(this.ptr, val);
        }
 
-       public boolean get_announced_channel(ChannelConfig this_ptr) {
-               boolean ret = bindings.ChannelConfig_get_announced_channel(this_ptr.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
+       public boolean get_commit_upfront_shutdown_pubkey() {
+               boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this.ptr);
                return ret;
        }
 
-       public void set_announced_channel(ChannelConfig this_ptr, boolean val) {
-               bindings.ChannelConfig_set_announced_channel(this_ptr.ptr & ~1, val);
-               this.ptrs_to.add(this_ptr);
+       public void set_commit_upfront_shutdown_pubkey(boolean val) {
+               bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val);
        }
 
-       public boolean get_commit_upfront_shutdown_pubkey(ChannelConfig this_ptr) {
-               boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               return ret;
+       public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
+               long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+               ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
        }
 
-       public void set_commit_upfront_shutdown_pubkey(ChannelConfig this_ptr, boolean val) {
-               bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr.ptr & ~1, val);
-               this.ptrs_to.add(this_ptr);
+       public ChannelConfig clone() {
+               long ret = bindings.ChannelConfig_clone(this.ptr);
+               ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
        }
 
-       public ChannelConfig(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
-               super(bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg));
+       public static ChannelConfig constructor_default() {
+               long ret = bindings.ChannelConfig_default();
+               ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
        }
 
-       public ChannelConfig() {
-               super(bindings.ChannelConfig_default());
+       public byte[] write() {
+               byte[] ret = bindings.ChannelConfig_write(this.ptr);
+               return ret;
        }
 
-       // Skipped ChannelConfig_write
-       public ChannelConfig(byte[] ser) {
-               super(bindings.ChannelConfig_read(ser));
+       public static Result_ChannelConfigDecodeErrorZ constructor_read(byte[] ser) {
+               long ret = bindings.ChannelConfig_read(ser);
+               Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
+               return ret_hu_conv;
        }
 
 }