Use AutoCloseable for structs named Locked*
[ldk-java] / src / main / java / org / ldk / structs / DirectionalChannelInfo.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class DirectionalChannelInfo extends CommonBase {
7         DirectionalChannelInfo(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 super.finalize();
11                 bindings.DirectionalChannelInfo_free(ptr);
12         }
13
14         public int get_last_update(DirectionalChannelInfo this_ptr) {
15                 int ret = bindings.DirectionalChannelInfo_get_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1);
16                 this.ptrs_to.add(this_ptr);
17                 return ret;
18         }
19
20         public void set_last_update(DirectionalChannelInfo this_ptr, int val) {
21                 bindings.DirectionalChannelInfo_set_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
22                 this.ptrs_to.add(this_ptr);
23         }
24
25         public boolean get_enabled(DirectionalChannelInfo this_ptr) {
26                 boolean ret = bindings.DirectionalChannelInfo_get_enabled(this_ptr == null ? 0 : this_ptr.ptr & ~1);
27                 this.ptrs_to.add(this_ptr);
28                 return ret;
29         }
30
31         public void set_enabled(DirectionalChannelInfo this_ptr, boolean val) {
32                 bindings.DirectionalChannelInfo_set_enabled(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
33                 this.ptrs_to.add(this_ptr);
34         }
35
36         public short get_cltv_expiry_delta(DirectionalChannelInfo this_ptr) {
37                 short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1);
38                 this.ptrs_to.add(this_ptr);
39                 return ret;
40         }
41
42         public void set_cltv_expiry_delta(DirectionalChannelInfo this_ptr, short val) {
43                 bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
44                 this.ptrs_to.add(this_ptr);
45         }
46
47         public long get_htlc_minimum_msat(DirectionalChannelInfo this_ptr) {
48                 long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
49                 this.ptrs_to.add(this_ptr);
50                 return ret;
51         }
52
53         public void set_htlc_minimum_msat(DirectionalChannelInfo this_ptr, long val) {
54                 bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
55                 this.ptrs_to.add(this_ptr);
56         }
57
58         public ChannelUpdate get_last_update_message(DirectionalChannelInfo this_ptr) {
59                 ChannelUpdate ret = new ChannelUpdate(null, bindings.DirectionalChannelInfo_get_last_update_message(this_ptr == null ? 0 : this_ptr.ptr & ~1));
60                 this.ptrs_to.add(this_ptr);
61                 return ret;
62         }
63
64         public void set_last_update_message(DirectionalChannelInfo this_ptr, ChannelUpdate val) {
65                 bindings.DirectionalChannelInfo_set_last_update_message(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
66                 this.ptrs_to.add(this_ptr);
67                 this.ptrs_to.add(val);
68         }
69
70         // Skipped DirectionalChannelInfo_write
71         public DirectionalChannelInfo(byte[] ser) {
72                 super(bindings.DirectionalChannelInfo_read(ser));
73         }
74
75 }