1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
13 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class ClosingSignedFeeRange extends CommonBase {
18 ClosingSignedFeeRange(Object _dummy, long ptr) { super(ptr); }
19 @Override @SuppressWarnings("deprecation")
20 protected void finalize() throws Throwable {
22 if (ptr != 0) { bindings.ClosingSignedFeeRange_free(ptr); }
26 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
29 public long get_min_fee_satoshis() {
30 long ret = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
31 Reference.reachabilityFence(this);
36 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
39 public void set_min_fee_satoshis(long val) {
40 bindings.ClosingSignedFeeRange_set_min_fee_satoshis(this.ptr, val);
41 Reference.reachabilityFence(this);
42 Reference.reachabilityFence(val);
46 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
49 public long get_max_fee_satoshis() {
50 long ret = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
51 Reference.reachabilityFence(this);
56 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
59 public void set_max_fee_satoshis(long val) {
60 bindings.ClosingSignedFeeRange_set_max_fee_satoshis(this.ptr, val);
61 Reference.reachabilityFence(this);
62 Reference.reachabilityFence(val);
66 * Constructs a new ClosingSignedFeeRange given each field
68 public static ClosingSignedFeeRange of(long min_fee_satoshis_arg, long max_fee_satoshis_arg) {
69 long ret = bindings.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
70 Reference.reachabilityFence(min_fee_satoshis_arg);
71 Reference.reachabilityFence(max_fee_satoshis_arg);
72 if (ret >= 0 && ret <= 4096) { return null; }
73 org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); }
74 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
79 long ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr);
80 Reference.reachabilityFence(this);
85 * Creates a copy of the ClosingSignedFeeRange
87 public ClosingSignedFeeRange clone() {
88 long ret = bindings.ClosingSignedFeeRange_clone(this.ptr);
89 Reference.reachabilityFence(this);
90 if (ret >= 0 && ret <= 4096) { return null; }
91 org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); }
92 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
97 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
98 * This ignores pointers and is_owned flags and looks at the values in fields.
99 * Two objects with NULL inner values will be considered "equal" here.
101 public boolean eq(ClosingSignedFeeRange b) {
102 boolean ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b == null ? 0 : b.ptr);
103 Reference.reachabilityFence(this);
104 Reference.reachabilityFence(b);
105 if (this != null) { this.ptrs_to.add(b); };
109 @Override public boolean equals(Object o) {
110 if (!(o instanceof ClosingSignedFeeRange)) return false;
111 return this.eq((ClosingSignedFeeRange)o);
114 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
116 public byte[] write() {
117 byte[] ret = bindings.ClosingSignedFeeRange_write(this.ptr);
118 Reference.reachabilityFence(this);
123 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
125 public static Result_ClosingSignedFeeRangeDecodeErrorZ read(byte[] ser) {
126 long ret = bindings.ClosingSignedFeeRange_read(ser);
127 Reference.reachabilityFence(ser);
128 if (ret >= 0 && ret <= 4096) { return null; }
129 Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);