8e51c3f245195a973a8d1d60d2f98397ff238eff
[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 import org.ldk.util.*;
6 import java.util.Arrays;
7
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class DirectionalChannelInfo extends CommonBase {
10         DirectionalChannelInfo(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.DirectionalChannelInfo_free(ptr); }
15         }
16
17         public int get_last_update() {
18                 int ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr);
19                 return ret;
20         }
21
22         public void set_last_update(int val) {
23                 bindings.DirectionalChannelInfo_set_last_update(this.ptr, val);
24         }
25
26         public boolean get_enabled() {
27                 boolean ret = bindings.DirectionalChannelInfo_get_enabled(this.ptr);
28                 return ret;
29         }
30
31         public void set_enabled(boolean val) {
32                 bindings.DirectionalChannelInfo_set_enabled(this.ptr, val);
33         }
34
35         public short get_cltv_expiry_delta() {
36                 short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr);
37                 return ret;
38         }
39
40         public void set_cltv_expiry_delta(short val) {
41                 bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val);
42         }
43
44         public long get_htlc_minimum_msat() {
45                 long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr);
46                 return ret;
47         }
48
49         public void set_htlc_minimum_msat(long val) {
50                 bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val);
51         }
52
53         public RoutingFees get_fees() {
54                 long ret = bindings.DirectionalChannelInfo_get_fees(this.ptr);
55                 RoutingFees ret_hu_conv = new RoutingFees(null, ret);
56                 ret_hu_conv.ptrs_to.add(this);
57                 return ret_hu_conv;
58         }
59
60         public void set_fees(RoutingFees val) {
61                 bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
62                 this.ptrs_to.add(val);
63         }
64
65         public ChannelUpdate get_last_update_message() {
66                 long ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr);
67                 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
68                 ret_hu_conv.ptrs_to.add(this);
69                 return ret_hu_conv;
70         }
71
72         public void set_last_update_message(ChannelUpdate val) {
73                 bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr & ~1);
74                 this.ptrs_to.add(val);
75         }
76
77         public DirectionalChannelInfo clone() {
78                 long ret = bindings.DirectionalChannelInfo_clone(this.ptr);
79                 DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
80                 ret_hu_conv.ptrs_to.add(this);
81                 return ret_hu_conv;
82         }
83
84         public byte[] write() {
85                 byte[] ret = bindings.DirectionalChannelInfo_write(this.ptr);
86                 return ret;
87         }
88
89         public static Result_DirectionalChannelInfoDecodeErrorZ constructor_read(byte[] ser) {
90                 long ret = bindings.DirectionalChannelInfo_read(ser);
91                 Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
92                 return ret_hu_conv;
93         }
94
95 }