X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FDirectionalChannelInfo.java;h=8e51c3f245195a973a8d1d60d2f98397ff238eff;hb=9e8763c71cd61d55be7c869d973524f75209a3f3;hp=bcb2e8e37609c6e08ab53a6554758c97e6b2ba25;hpb=592c4f92dd3011a2f2a7988ce66ed166c3a8f58c;p=ldk-java diff --git a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java index bcb2e8e3..8e51c3f2 100644 --- a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java @@ -2,79 +2,94 @@ 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 DirectionalChannelInfo extends CommonBase { DirectionalChannelInfo(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - bindings.DirectionalChannelInfo_free(ptr); + if (ptr != 0) { bindings.DirectionalChannelInfo_free(ptr); } } - public int get_last_update(DirectionalChannelInfo this_ptr) { - int ret = bindings.DirectionalChannelInfo_get_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public int get_last_update() { + int ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr); return ret; } - public void set_last_update(DirectionalChannelInfo this_ptr, int val) { - bindings.DirectionalChannelInfo_set_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_last_update(int val) { + bindings.DirectionalChannelInfo_set_last_update(this.ptr, val); } - public boolean get_enabled(DirectionalChannelInfo this_ptr) { - boolean ret = bindings.DirectionalChannelInfo_get_enabled(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public boolean get_enabled() { + boolean ret = bindings.DirectionalChannelInfo_get_enabled(this.ptr); return ret; } - public void set_enabled(DirectionalChannelInfo this_ptr, boolean val) { - bindings.DirectionalChannelInfo_set_enabled(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_enabled(boolean val) { + bindings.DirectionalChannelInfo_set_enabled(this.ptr, val); } - public short get_cltv_expiry_delta(DirectionalChannelInfo this_ptr) { - short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public short get_cltv_expiry_delta() { + short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr); return ret; } - public void set_cltv_expiry_delta(DirectionalChannelInfo this_ptr, short val) { - bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_cltv_expiry_delta(short val) { + bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val); } - public long get_htlc_minimum_msat(DirectionalChannelInfo this_ptr) { - long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public long get_htlc_minimum_msat() { + long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr); return ret; } - public void set_htlc_minimum_msat(DirectionalChannelInfo this_ptr, long val) { - bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_htlc_minimum_msat(long val) { + bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val); } - public ChannelUpdate get_last_update_message(DirectionalChannelInfo this_ptr) { - ChannelUpdate ret = new ChannelUpdate(null, bindings.DirectionalChannelInfo_get_last_update_message(this_ptr == null ? 0 : this_ptr.ptr & ~1)); - this.ptrs_to.add(this_ptr); - return ret; + public RoutingFees get_fees() { + long ret = bindings.DirectionalChannelInfo_get_fees(this.ptr); + RoutingFees ret_hu_conv = new RoutingFees(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_fees(RoutingFees val) { + bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); } - public void set_last_update_message(DirectionalChannelInfo this_ptr, ChannelUpdate val) { - bindings.DirectionalChannelInfo_set_last_update_message(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(this_ptr); + public ChannelUpdate get_last_update_message() { + long ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr); + ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_last_update_message(ChannelUpdate val) { + bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } - public byte[] write(DirectionalChannelInfo obj) { - byte[] ret = bindings.DirectionalChannelInfo_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public DirectionalChannelInfo clone() { + long ret = bindings.DirectionalChannelInfo_clone(this.ptr); + DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public byte[] write() { + byte[] ret = bindings.DirectionalChannelInfo_write(this.ptr); return ret; } - public DirectionalChannelInfo(byte[] ser) { - super(bindings.DirectionalChannelInfo_read(ser)); + public static Result_DirectionalChannelInfoDecodeErrorZ constructor_read(byte[] ser) { + long ret = bindings.DirectionalChannelInfo_read(ser); + Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; } }