1e36ed5935fe2de7e76995d5bff4d88d01a64896
[ldk-java] / src / main / java / org / ldk / structs / RouteHop.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 RouteHop extends CommonBase {
10         RouteHop(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.RouteHop_free(ptr); }
15         }
16
17         public byte[] get_pubkey() {
18                 byte[] ret = bindings.RouteHop_get_pubkey(this.ptr);
19                 return ret;
20         }
21
22         public void set_pubkey(byte[] val) {
23                 bindings.RouteHop_set_pubkey(this.ptr, val);
24         }
25
26         public NodeFeatures get_node_features() {
27                 long ret = bindings.RouteHop_get_node_features(this.ptr);
28                 NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
29                 ret_hu_conv.ptrs_to.add(this);
30                 return ret_hu_conv;
31         }
32
33         public void set_node_features(NodeFeatures val) {
34                 bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr & ~1);
35                 this.ptrs_to.add(val);
36         }
37
38         public long get_short_channel_id() {
39                 long ret = bindings.RouteHop_get_short_channel_id(this.ptr);
40                 return ret;
41         }
42
43         public void set_short_channel_id(long val) {
44                 bindings.RouteHop_set_short_channel_id(this.ptr, val);
45         }
46
47         public ChannelFeatures get_channel_features() {
48                 long ret = bindings.RouteHop_get_channel_features(this.ptr);
49                 ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
50                 ret_hu_conv.ptrs_to.add(this);
51                 return ret_hu_conv;
52         }
53
54         public void set_channel_features(ChannelFeatures val) {
55                 bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr & ~1);
56                 this.ptrs_to.add(val);
57         }
58
59         public long get_fee_msat() {
60                 long ret = bindings.RouteHop_get_fee_msat(this.ptr);
61                 return ret;
62         }
63
64         public void set_fee_msat(long val) {
65                 bindings.RouteHop_set_fee_msat(this.ptr, val);
66         }
67
68         public int get_cltv_expiry_delta() {
69                 int ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr);
70                 return ret;
71         }
72
73         public void set_cltv_expiry_delta(int val) {
74                 bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val);
75         }
76
77         public static RouteHop constructor_new(byte[] pubkey_arg, NodeFeatures node_features_arg, long short_channel_id_arg, ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) {
78                 long ret = bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg);
79                 RouteHop ret_hu_conv = new RouteHop(null, ret);
80                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
81                 ret_hu_conv.ptrs_to.add(node_features_arg);
82                 ret_hu_conv.ptrs_to.add(channel_features_arg);
83                 return ret_hu_conv;
84         }
85
86         public RouteHop clone() {
87                 long ret = bindings.RouteHop_clone(this.ptr);
88                 RouteHop ret_hu_conv = new RouteHop(null, ret);
89                 ret_hu_conv.ptrs_to.add(this);
90                 return ret_hu_conv;
91         }
92
93 }