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.
14 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
17 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
18 public class ClosingSignedFeeRange extends CommonBase {
19 ClosingSignedFeeRange(Object _dummy, long ptr) { super(ptr); }
20 @Override @SuppressWarnings("deprecation")
21 protected void finalize() throws Throwable {
23 if (ptr != 0) { bindings.ClosingSignedFeeRange_free(ptr); }
27 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
30 public long get_min_fee_satoshis() {
31 long ret = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
32 Reference.reachabilityFence(this);
37 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
40 public void set_min_fee_satoshis(long val) {
41 bindings.ClosingSignedFeeRange_set_min_fee_satoshis(this.ptr, val);
42 Reference.reachabilityFence(this);
43 Reference.reachabilityFence(val);
47 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
50 public long get_max_fee_satoshis() {
51 long ret = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
52 Reference.reachabilityFence(this);
57 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
60 public void set_max_fee_satoshis(long val) {
61 bindings.ClosingSignedFeeRange_set_max_fee_satoshis(this.ptr, val);
62 Reference.reachabilityFence(this);
63 Reference.reachabilityFence(val);
67 * Constructs a new ClosingSignedFeeRange given each field
69 public static ClosingSignedFeeRange of(long min_fee_satoshis_arg, long max_fee_satoshis_arg) {
70 long ret = bindings.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
71 Reference.reachabilityFence(min_fee_satoshis_arg);
72 Reference.reachabilityFence(max_fee_satoshis_arg);
73 if (ret >= 0 && ret <= 4096) { return null; }
74 org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); }
75 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
80 long ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr);
81 Reference.reachabilityFence(this);
86 * Creates a copy of the ClosingSignedFeeRange
88 public ClosingSignedFeeRange clone() {
89 long ret = bindings.ClosingSignedFeeRange_clone(this.ptr);
90 Reference.reachabilityFence(this);
91 if (ret >= 0 && ret <= 4096) { return null; }
92 org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); }
93 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
98 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
99 * This ignores pointers and is_owned flags and looks at the values in fields.
100 * Two objects with NULL inner values will be considered "equal" here.
102 public boolean eq(org.ldk.structs.ClosingSignedFeeRange b) {
103 boolean ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b == null ? 0 : b.ptr);
104 Reference.reachabilityFence(this);
105 Reference.reachabilityFence(b);
106 if (this != null) { this.ptrs_to.add(b); };
110 @Override public boolean equals(Object o) {
111 if (!(o instanceof ClosingSignedFeeRange)) return false;
112 return this.eq((ClosingSignedFeeRange)o);
115 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
117 public byte[] write() {
118 byte[] ret = bindings.ClosingSignedFeeRange_write(this.ptr);
119 Reference.reachabilityFence(this);
124 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
126 public static Result_ClosingSignedFeeRangeDecodeErrorZ read(byte[] ser) {
127 long ret = bindings.ClosingSignedFeeRange_read(ser);
128 Reference.reachabilityFence(ser);
129 if (ret >= 0 && ret <= 4096) { return null; }
130 Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);