Use AutoCloseable for structs named Locked*
[ldk-java] / src / main / java / org / ldk / structs / OpenChannel.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class OpenChannel extends CommonBase {
7         OpenChannel(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 super.finalize();
11                 bindings.OpenChannel_free(ptr);
12         }
13
14         public OpenChannel(OpenChannel orig) {
15                 super(bindings.OpenChannel_clone(orig == null ? 0 : orig.ptr & ~1));
16                 this.ptrs_to.add(orig);
17         }
18
19         public byte[] get_chain_hash(OpenChannel this_ptr) {
20                 byte[] ret = bindings.OpenChannel_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1);
21                 this.ptrs_to.add(this_ptr);
22                 return ret;
23         }
24
25         public void set_chain_hash(OpenChannel this_ptr, byte[] val) {
26                 bindings.OpenChannel_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
27                 this.ptrs_to.add(this_ptr);
28         }
29
30         public byte[] get_temporary_channel_id(OpenChannel this_ptr) {
31                 byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
32                 this.ptrs_to.add(this_ptr);
33                 return ret;
34         }
35
36         public void set_temporary_channel_id(OpenChannel this_ptr, byte[] val) {
37                 bindings.OpenChannel_set_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
38                 this.ptrs_to.add(this_ptr);
39         }
40
41         public long get_funding_satoshis(OpenChannel this_ptr) {
42                 long ret = bindings.OpenChannel_get_funding_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1);
43                 this.ptrs_to.add(this_ptr);
44                 return ret;
45         }
46
47         public void set_funding_satoshis(OpenChannel this_ptr, long val) {
48                 bindings.OpenChannel_set_funding_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
49                 this.ptrs_to.add(this_ptr);
50         }
51
52         public long get_push_msat(OpenChannel this_ptr) {
53                 long ret = bindings.OpenChannel_get_push_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
54                 this.ptrs_to.add(this_ptr);
55                 return ret;
56         }
57
58         public void set_push_msat(OpenChannel this_ptr, long val) {
59                 bindings.OpenChannel_set_push_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
60                 this.ptrs_to.add(this_ptr);
61         }
62
63         public long get_dust_limit_satoshis(OpenChannel this_ptr) {
64                 long ret = bindings.OpenChannel_get_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1);
65                 this.ptrs_to.add(this_ptr);
66                 return ret;
67         }
68
69         public void set_dust_limit_satoshis(OpenChannel this_ptr, long val) {
70                 bindings.OpenChannel_set_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
71                 this.ptrs_to.add(this_ptr);
72         }
73
74         public long get_max_htlc_value_in_flight_msat(OpenChannel this_ptr) {
75                 long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
76                 this.ptrs_to.add(this_ptr);
77                 return ret;
78         }
79
80         public void set_max_htlc_value_in_flight_msat(OpenChannel this_ptr, long val) {
81                 bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
82                 this.ptrs_to.add(this_ptr);
83         }
84
85         public long get_channel_reserve_satoshis(OpenChannel this_ptr) {
86                 long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1);
87                 this.ptrs_to.add(this_ptr);
88                 return ret;
89         }
90
91         public void set_channel_reserve_satoshis(OpenChannel this_ptr, long val) {
92                 bindings.OpenChannel_set_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
93                 this.ptrs_to.add(this_ptr);
94         }
95
96         public long get_htlc_minimum_msat(OpenChannel this_ptr) {
97                 long ret = bindings.OpenChannel_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
98                 this.ptrs_to.add(this_ptr);
99                 return ret;
100         }
101
102         public void set_htlc_minimum_msat(OpenChannel this_ptr, long val) {
103                 bindings.OpenChannel_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
104                 this.ptrs_to.add(this_ptr);
105         }
106
107         public int get_feerate_per_kw(OpenChannel this_ptr) {
108                 int ret = bindings.OpenChannel_get_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1);
109                 this.ptrs_to.add(this_ptr);
110                 return ret;
111         }
112
113         public void set_feerate_per_kw(OpenChannel this_ptr, int val) {
114                 bindings.OpenChannel_set_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
115                 this.ptrs_to.add(this_ptr);
116         }
117
118         public short get_to_self_delay(OpenChannel this_ptr) {
119                 short ret = bindings.OpenChannel_get_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1);
120                 this.ptrs_to.add(this_ptr);
121                 return ret;
122         }
123
124         public void set_to_self_delay(OpenChannel this_ptr, short val) {
125                 bindings.OpenChannel_set_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
126                 this.ptrs_to.add(this_ptr);
127         }
128
129         public short get_max_accepted_htlcs(OpenChannel this_ptr) {
130                 short ret = bindings.OpenChannel_get_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1);
131                 this.ptrs_to.add(this_ptr);
132                 return ret;
133         }
134
135         public void set_max_accepted_htlcs(OpenChannel this_ptr, short val) {
136                 bindings.OpenChannel_set_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
137                 this.ptrs_to.add(this_ptr);
138         }
139
140         public byte[] get_funding_pubkey(OpenChannel this_ptr) {
141                 byte[] ret = bindings.OpenChannel_get_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1);
142                 this.ptrs_to.add(this_ptr);
143                 return ret;
144         }
145
146         public void set_funding_pubkey(OpenChannel this_ptr, byte[] val) {
147                 bindings.OpenChannel_set_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
148                 this.ptrs_to.add(this_ptr);
149         }
150
151         public byte[] get_revocation_basepoint(OpenChannel this_ptr) {
152                 byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1);
153                 this.ptrs_to.add(this_ptr);
154                 return ret;
155         }
156
157         public void set_revocation_basepoint(OpenChannel this_ptr, byte[] val) {
158                 bindings.OpenChannel_set_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
159                 this.ptrs_to.add(this_ptr);
160         }
161
162         public byte[] get_payment_point(OpenChannel this_ptr) {
163                 byte[] ret = bindings.OpenChannel_get_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1);
164                 this.ptrs_to.add(this_ptr);
165                 return ret;
166         }
167
168         public void set_payment_point(OpenChannel this_ptr, byte[] val) {
169                 bindings.OpenChannel_set_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
170                 this.ptrs_to.add(this_ptr);
171         }
172
173         public byte[] get_delayed_payment_basepoint(OpenChannel this_ptr) {
174                 byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1);
175                 this.ptrs_to.add(this_ptr);
176                 return ret;
177         }
178
179         public void set_delayed_payment_basepoint(OpenChannel this_ptr, byte[] val) {
180                 bindings.OpenChannel_set_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
181                 this.ptrs_to.add(this_ptr);
182         }
183
184         public byte[] get_htlc_basepoint(OpenChannel this_ptr) {
185                 byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1);
186                 this.ptrs_to.add(this_ptr);
187                 return ret;
188         }
189
190         public void set_htlc_basepoint(OpenChannel this_ptr, byte[] val) {
191                 bindings.OpenChannel_set_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
192                 this.ptrs_to.add(this_ptr);
193         }
194
195         public byte[] get_first_per_commitment_point(OpenChannel this_ptr) {
196                 byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1);
197                 this.ptrs_to.add(this_ptr);
198                 return ret;
199         }
200
201         public void set_first_per_commitment_point(OpenChannel this_ptr, byte[] val) {
202                 bindings.OpenChannel_set_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
203                 this.ptrs_to.add(this_ptr);
204         }
205
206         public byte get_channel_flags(OpenChannel this_ptr) {
207                 byte ret = bindings.OpenChannel_get_channel_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1);
208                 this.ptrs_to.add(this_ptr);
209                 return ret;
210         }
211
212         public void set_channel_flags(OpenChannel this_ptr, byte val) {
213                 bindings.OpenChannel_set_channel_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
214                 this.ptrs_to.add(this_ptr);
215         }
216
217         // Skipped OpenChannel_write
218         public OpenChannel(byte[] ser) {
219                 super(bindings.OpenChannel_read(ser));
220         }
221
222 }