X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelConfig.java;h=ed37eb1d7e0d0e7b97000d4ad96cb0f57d5725cf;hb=aa0e2aade37133339f4113a0cd7465b111f0a0d0;hp=7676cae3051952892f79503781f7c101a6818565;hpb=2ed9081562d00a8645604b07629e963231d49e0f;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index 7676cae3..ed37eb1d 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -2,63 +2,74 @@ 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 == null ? 0 : orig.ptr & ~1)); - this.ptrs_to.add(orig); + public static ChannelConfig constructor_clone(ChannelConfig orig) { + long ret = bindings.ChannelConfig_clone(orig == null ? 0 : orig.ptr & ~1); + ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + ret_hu_conv.ptrs_to.add(orig); + return ret_hu_conv; } - public int get_fee_proportional_millionths(ChannelConfig this_ptr) { - int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public int get_fee_proportional_millionths() { + int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this.ptr); return ret; } - public void set_fee_proportional_millionths(ChannelConfig this_ptr, int val) { - bindings.ChannelConfig_set_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_fee_proportional_millionths(int val) { + bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val); } - public boolean get_announced_channel(ChannelConfig this_ptr) { - boolean ret = bindings.ChannelConfig_get_announced_channel(this_ptr == null ? 0 : 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_announced_channel(ChannelConfig this_ptr, boolean val) { - bindings.ChannelConfig_set_announced_channel(this_ptr == null ? 0 : 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_commit_upfront_shutdown_pubkey(ChannelConfig this_ptr) { - boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr == null ? 0 : 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_commit_upfront_shutdown_pubkey(ChannelConfig this_ptr, boolean val) { - bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr == null ? 0 : 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 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_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); + return ret_hu_conv; } - public ChannelConfig() { - super(bindings.ChannelConfig_default()); + public static ChannelConfig constructor_default() { + long ret = bindings.ChannelConfig_default(); + ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + return ret_hu_conv; } - // Skipped ChannelConfig_write - public ChannelConfig(byte[] ser) { - super(bindings.ChannelConfig_read(ser)); + public byte[] write(ChannelConfig obj) { + byte[] ret = bindings.ChannelConfig_write(obj == null ? 0 : obj.ptr & ~1); + this.ptrs_to.add(obj); + return ret; + } + + public static ChannelConfig constructor_read(byte[] ser) { + long ret = bindings.ChannelConfig_read(ser); + ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + return ret_hu_conv; } }