Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / ClosingSignedFeeRange.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
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
14  * to use.
15  */
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 {
21                 super.finalize();
22                 if (ptr != 0) { bindings.ClosingSignedFeeRange_free(ptr); }
23         }
24
25         /**
26          * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
27          * transaction.
28          */
29         public long get_min_fee_satoshis() {
30                 long ret = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
31                 Reference.reachabilityFence(this);
32                 return ret;
33         }
34
35         /**
36          * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
37          * transaction.
38          */
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);
43         }
44
45         /**
46          * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
47          * transaction.
48          */
49         public long get_max_fee_satoshis() {
50                 long ret = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
51                 Reference.reachabilityFence(this);
52                 return ret;
53         }
54
55         /**
56          * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
57          * transaction.
58          */
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);
63         }
64
65         /**
66          * Constructs a new ClosingSignedFeeRange given each field
67          */
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                 ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); }
74                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
75                 return ret_hu_conv;
76         }
77
78         long clone_ptr() {
79                 long ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr);
80                 Reference.reachabilityFence(this);
81                 return ret;
82         }
83
84         /**
85          * Creates a copy of the ClosingSignedFeeRange
86          */
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                 ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); }
92                 ret_hu_conv.ptrs_to.add(this);
93                 return ret_hu_conv;
94         }
95
96         /**
97          * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
98          */
99         public byte[] write() {
100                 byte[] ret = bindings.ClosingSignedFeeRange_write(this.ptr);
101                 Reference.reachabilityFence(this);
102                 return ret;
103         }
104
105         /**
106          * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
107          */
108         public static Result_ClosingSignedFeeRangeDecodeErrorZ read(byte[] ser) {
109                 long ret = bindings.ClosingSignedFeeRange_read(ser);
110                 Reference.reachabilityFence(ser);
111                 if (ret >= 0 && ret <= 4096) { return null; }
112                 Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
113                 return ret_hu_conv;
114         }
115
116 }