[Java] Update auto-generated Java bindings to LDK 0.0.121
[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  * 
14  * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
15  * to use.
16  */
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 {
22                 super.finalize();
23                 if (ptr != 0) { bindings.ClosingSignedFeeRange_free(ptr); }
24         }
25
26         /**
27          * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
28          * transaction.
29          */
30         public long get_min_fee_satoshis() {
31                 long ret = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
32                 Reference.reachabilityFence(this);
33                 return ret;
34         }
35
36         /**
37          * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
38          * transaction.
39          */
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);
44         }
45
46         /**
47          * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
48          * transaction.
49          */
50         public long get_max_fee_satoshis() {
51                 long ret = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
52                 Reference.reachabilityFence(this);
53                 return ret;
54         }
55
56         /**
57          * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
58          * transaction.
59          */
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);
64         }
65
66         /**
67          * Constructs a new ClosingSignedFeeRange given each field
68          */
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); };
76                 return ret_hu_conv;
77         }
78
79         long clone_ptr() {
80                 long ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr);
81                 Reference.reachabilityFence(this);
82                 return ret;
83         }
84
85         /**
86          * Creates a copy of the ClosingSignedFeeRange
87          */
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); };
94                 return ret_hu_conv;
95         }
96
97         /**
98          * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
99          */
100         public long hash() {
101                 long ret = bindings.ClosingSignedFeeRange_hash(this.ptr);
102                 Reference.reachabilityFence(this);
103                 return ret;
104         }
105
106         @Override public int hashCode() {
107                 return (int)this.hash();
108         }
109         /**
110          * Checks if two ClosingSignedFeeRanges contain equal inner contents.
111          * This ignores pointers and is_owned flags and looks at the values in fields.
112          * Two objects with NULL inner values will be considered "equal" here.
113          */
114         public boolean eq(org.ldk.structs.ClosingSignedFeeRange b) {
115                 boolean ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b == null ? 0 : b.ptr);
116                 Reference.reachabilityFence(this);
117                 Reference.reachabilityFence(b);
118                 if (this != null) { this.ptrs_to.add(b); };
119                 return ret;
120         }
121
122         @Override public boolean equals(Object o) {
123                 if (!(o instanceof ClosingSignedFeeRange)) return false;
124                 return this.eq((ClosingSignedFeeRange)o);
125         }
126         /**
127          * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
128          */
129         public byte[] write() {
130                 byte[] ret = bindings.ClosingSignedFeeRange_write(this.ptr);
131                 Reference.reachabilityFence(this);
132                 return ret;
133         }
134
135         /**
136          * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
137          */
138         public static Result_ClosingSignedFeeRangeDecodeErrorZ read(byte[] ser) {
139                 long ret = bindings.ClosingSignedFeeRange_read(ser);
140                 Reference.reachabilityFence(ser);
141                 if (ret >= 0 && ret <= 4096) { return null; }
142                 Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
143                 return ret_hu_conv;
144         }
145
146 }