Use AutoCloseable for structs named Locked*
[ldk-java] / src / main / java / org / ldk / structs / RouteHint.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class RouteHint extends CommonBase {
7         RouteHint(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 super.finalize();
11                 bindings.RouteHint_free(ptr);
12         }
13
14         public RouteHint(RouteHint orig) {
15                 super(bindings.RouteHint_clone(orig == null ? 0 : orig.ptr & ~1));
16                 this.ptrs_to.add(orig);
17         }
18
19         public byte[] get_src_node_id(RouteHint this_ptr) {
20                 byte[] ret = bindings.RouteHint_get_src_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
21                 this.ptrs_to.add(this_ptr);
22                 return ret;
23         }
24
25         public void set_src_node_id(RouteHint this_ptr, byte[] val) {
26                 bindings.RouteHint_set_src_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
27                 this.ptrs_to.add(this_ptr);
28         }
29
30         public long get_short_channel_id(RouteHint this_ptr) {
31                 long ret = bindings.RouteHint_get_short_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_short_channel_id(RouteHint this_ptr, long val) {
37                 bindings.RouteHint_set_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
38                 this.ptrs_to.add(this_ptr);
39         }
40
41         public RoutingFees get_fees(RouteHint this_ptr) {
42                 RoutingFees ret = new RoutingFees(null, bindings.RouteHint_get_fees(this_ptr == null ? 0 : this_ptr.ptr & ~1));
43                 this.ptrs_to.add(this_ptr);
44                 return ret;
45         }
46
47         public void set_fees(RouteHint this_ptr, RoutingFees val) {
48                 bindings.RouteHint_set_fees(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
49                 this.ptrs_to.add(this_ptr);
50                 this.ptrs_to.add(val);
51         }
52
53         public short get_cltv_expiry_delta(RouteHint this_ptr) {
54                 short ret = bindings.RouteHint_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1);
55                 this.ptrs_to.add(this_ptr);
56                 return ret;
57         }
58
59         public void set_cltv_expiry_delta(RouteHint this_ptr, short val) {
60                 bindings.RouteHint_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
61                 this.ptrs_to.add(this_ptr);
62         }
63
64         public long get_htlc_minimum_msat(RouteHint this_ptr) {
65                 long ret = bindings.RouteHint_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
66                 this.ptrs_to.add(this_ptr);
67                 return ret;
68         }
69
70         public void set_htlc_minimum_msat(RouteHint this_ptr, long val) {
71                 bindings.RouteHint_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
72                 this.ptrs_to.add(this_ptr);
73         }
74
75         public RouteHint(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg) {
76                 super(bindings.RouteHint_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg));
77                 this.ptrs_to.add(fees_arg);
78         }
79
80 }