d2bc2616a08456a2426ea66498cff0bcb26d4070
[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 import org.ldk.util.*;
6 import java.util.Arrays;
7
8
9 /**
10  * A channel descriptor which provides a last-hop route to get_route
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class RouteHint extends CommonBase {
14         RouteHint(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.RouteHint_free(ptr); }
19         }
20
21         /**
22          * The node_id of the non-target end of the route
23          */
24         public byte[] get_src_node_id() {
25                 byte[] ret = bindings.RouteHint_get_src_node_id(this.ptr);
26                 return ret;
27         }
28
29         /**
30          * The node_id of the non-target end of the route
31          */
32         public void set_src_node_id(byte[] val) {
33                 bindings.RouteHint_set_src_node_id(this.ptr, val);
34         }
35
36         /**
37          * The short_channel_id of this channel
38          */
39         public long get_short_channel_id() {
40                 long ret = bindings.RouteHint_get_short_channel_id(this.ptr);
41                 return ret;
42         }
43
44         /**
45          * The short_channel_id of this channel
46          */
47         public void set_short_channel_id(long val) {
48                 bindings.RouteHint_set_short_channel_id(this.ptr, val);
49         }
50
51         /**
52          * The fees which must be paid to use this channel
53          */
54         public RoutingFees get_fees() {
55                 long ret = bindings.RouteHint_get_fees(this.ptr);
56                 RoutingFees ret_hu_conv = new RoutingFees(null, ret);
57                 ret_hu_conv.ptrs_to.add(this);
58                 return ret_hu_conv;
59         }
60
61         /**
62          * The fees which must be paid to use this channel
63          */
64         public void set_fees(RoutingFees val) {
65                 bindings.RouteHint_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
66                 this.ptrs_to.add(val);
67         }
68
69         /**
70          * The difference in CLTV values between this node and the next node.
71          */
72         public short get_cltv_expiry_delta() {
73                 short ret = bindings.RouteHint_get_cltv_expiry_delta(this.ptr);
74                 return ret;
75         }
76
77         /**
78          * The difference in CLTV values between this node and the next node.
79          */
80         public void set_cltv_expiry_delta(short val) {
81                 bindings.RouteHint_set_cltv_expiry_delta(this.ptr, val);
82         }
83
84         /**
85          * Creates a copy of the RouteHint
86          */
87         public RouteHint clone() {
88                 long ret = bindings.RouteHint_clone(this.ptr);
89                 RouteHint ret_hu_conv = new RouteHint(null, ret);
90                 ret_hu_conv.ptrs_to.add(this);
91                 return ret_hu_conv;
92         }
93
94 }