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