X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FAcceptChannel.java;h=f6ba8ed457b83893af5ae4cc558417c428433f47;hb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;hp=5397d48e6def25a9b49f23b4facd2a96839d5542;hpb=592c4f92dd3011a2f2a7988ce66ed166c3a8f58c;p=ldk-java diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 5397d48e..f6ba8ed4 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -2,182 +2,161 @@ 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 AcceptChannel extends CommonBase { AcceptChannel(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - bindings.AcceptChannel_free(ptr); + if (ptr != 0) { bindings.AcceptChannel_free(ptr); } } - public AcceptChannel(AcceptChannel orig) { - super(bindings.AcceptChannel_clone(orig == null ? 0 : orig.ptr & ~1)); - this.ptrs_to.add(orig); + public AcceptChannel clone() { + long ret = bindings.AcceptChannel_clone(this.ptr); + AcceptChannel ret_hu_conv = new AcceptChannel(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; } - public byte[] get_temporary_channel_id(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_temporary_channel_id() { + byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr); return ret; } - public void set_temporary_channel_id(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_temporary_channel_id(byte[] val) { + bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val); } - public long get_dust_limit_satoshis(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public long get_dust_limit_satoshis() { + long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr); return ret; } - public void set_dust_limit_satoshis(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_set_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_dust_limit_satoshis(long val) { + bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val); } - public long get_max_htlc_value_in_flight_msat(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public long get_max_htlc_value_in_flight_msat() { + long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr); return ret; } - public void set_max_htlc_value_in_flight_msat(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_max_htlc_value_in_flight_msat(long val) { + bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); } - public long get_channel_reserve_satoshis(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public long get_channel_reserve_satoshis() { + long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr); return ret; } - public void set_channel_reserve_satoshis(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_set_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_channel_reserve_satoshis(long val) { + bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val); } - public long get_htlc_minimum_msat(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_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.AcceptChannel_get_htlc_minimum_msat(this.ptr); return ret; } - public void set_htlc_minimum_msat(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_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.AcceptChannel_set_htlc_minimum_msat(this.ptr, val); } - public int get_minimum_depth(AcceptChannel this_ptr) { - int ret = bindings.AcceptChannel_get_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public int get_minimum_depth() { + int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr); return ret; } - public void set_minimum_depth(AcceptChannel this_ptr, int val) { - bindings.AcceptChannel_set_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_minimum_depth(int val) { + bindings.AcceptChannel_set_minimum_depth(this.ptr, val); } - public short get_to_self_delay(AcceptChannel this_ptr) { - short ret = bindings.AcceptChannel_get_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public short get_to_self_delay() { + short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr); return ret; } - public void set_to_self_delay(AcceptChannel this_ptr, short val) { - bindings.AcceptChannel_set_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_to_self_delay(short val) { + bindings.AcceptChannel_set_to_self_delay(this.ptr, val); } - public short get_max_accepted_htlcs(AcceptChannel this_ptr) { - short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public short get_max_accepted_htlcs() { + short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr); return ret; } - public void set_max_accepted_htlcs(AcceptChannel this_ptr, short val) { - bindings.AcceptChannel_set_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_max_accepted_htlcs(short val) { + bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val); } - public byte[] get_funding_pubkey(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_funding_pubkey() { + byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr); return ret; } - public void set_funding_pubkey(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_funding_pubkey(byte[] val) { + bindings.AcceptChannel_set_funding_pubkey(this.ptr, val); } - public byte[] get_revocation_basepoint(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_revocation_basepoint() { + byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr); return ret; } - public void set_revocation_basepoint(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_revocation_basepoint(byte[] val) { + bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val); } - public byte[] get_payment_point(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_payment_point() { + byte[] ret = bindings.AcceptChannel_get_payment_point(this.ptr); return ret; } - public void set_payment_point(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_payment_point(byte[] val) { + bindings.AcceptChannel_set_payment_point(this.ptr, val); } - public byte[] get_delayed_payment_basepoint(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_delayed_payment_basepoint() { + byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr); return ret; } - public void set_delayed_payment_basepoint(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_delayed_payment_basepoint(byte[] val) { + bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val); } - public byte[] get_htlc_basepoint(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_htlc_basepoint() { + byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr); return ret; } - public void set_htlc_basepoint(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_htlc_basepoint(byte[] val) { + bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val); } - public byte[] get_first_per_commitment_point(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_first_per_commitment_point() { + byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr); return ret; } - public void set_first_per_commitment_point(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_first_per_commitment_point(byte[] val) { + bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val); } - public byte[] write(AcceptChannel obj) { - byte[] ret = bindings.AcceptChannel_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.AcceptChannel_write(this.ptr); return ret; } - public AcceptChannel(byte[] ser) { - super(bindings.AcceptChannel_read(ser)); + public static AcceptChannel constructor_read(byte[] ser) { + long ret = bindings.AcceptChannel_read(ser); + AcceptChannel ret_hu_conv = new AcceptChannel(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; } }