[Java] Update auto-generated bindings to 0.0.117
[ldk-java] / src / main / java / org / ldk / structs / ForwardNode.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 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * An intermediate node, its outbound channel, and relay parameters.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class ForwardNode extends CommonBase {
16         ForwardNode(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.ForwardNode_free(ptr); }
21         }
22
23         /**
24          * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
25          * used for [`BlindedPayInfo`] construction.
26          */
27         public ForwardTlvs get_tlvs() {
28                 long ret = bindings.ForwardNode_get_tlvs(this.ptr);
29                 Reference.reachabilityFence(this);
30                 if (ret >= 0 && ret <= 4096) { return null; }
31                 org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); }
32                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
33                 return ret_hu_conv;
34         }
35
36         /**
37          * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
38          * used for [`BlindedPayInfo`] construction.
39          */
40         public void set_tlvs(org.ldk.structs.ForwardTlvs val) {
41                 bindings.ForwardNode_set_tlvs(this.ptr, val == null ? 0 : val.ptr);
42                 Reference.reachabilityFence(this);
43                 Reference.reachabilityFence(val);
44                 if (this != null) { this.ptrs_to.add(val); };
45         }
46
47         /**
48          * This node's pubkey.
49          */
50         public byte[] get_node_id() {
51                 byte[] ret = bindings.ForwardNode_get_node_id(this.ptr);
52                 Reference.reachabilityFence(this);
53                 return ret;
54         }
55
56         /**
57          * This node's pubkey.
58          */
59         public void set_node_id(byte[] val) {
60                 bindings.ForwardNode_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33));
61                 Reference.reachabilityFence(this);
62                 Reference.reachabilityFence(val);
63         }
64
65         /**
66          * The maximum value, in msat, that may be accepted by this node.
67          */
68         public long get_htlc_maximum_msat() {
69                 long ret = bindings.ForwardNode_get_htlc_maximum_msat(this.ptr);
70                 Reference.reachabilityFence(this);
71                 return ret;
72         }
73
74         /**
75          * The maximum value, in msat, that may be accepted by this node.
76          */
77         public void set_htlc_maximum_msat(long val) {
78                 bindings.ForwardNode_set_htlc_maximum_msat(this.ptr, val);
79                 Reference.reachabilityFence(this);
80                 Reference.reachabilityFence(val);
81         }
82
83         /**
84          * Constructs a new ForwardNode given each field
85          */
86         public static ForwardNode of(org.ldk.structs.ForwardTlvs tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg) {
87                 long ret = bindings.ForwardNode_new(tlvs_arg == null ? 0 : tlvs_arg.ptr, InternalUtils.check_arr_len(node_id_arg, 33), htlc_maximum_msat_arg);
88                 Reference.reachabilityFence(tlvs_arg);
89                 Reference.reachabilityFence(node_id_arg);
90                 Reference.reachabilityFence(htlc_maximum_msat_arg);
91                 if (ret >= 0 && ret <= 4096) { return null; }
92                 org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(null, ret); }
93                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
94                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(tlvs_arg); };
95                 return ret_hu_conv;
96         }
97
98         long clone_ptr() {
99                 long ret = bindings.ForwardNode_clone_ptr(this.ptr);
100                 Reference.reachabilityFence(this);
101                 return ret;
102         }
103
104         /**
105          * Creates a copy of the ForwardNode
106          */
107         public ForwardNode clone() {
108                 long ret = bindings.ForwardNode_clone(this.ptr);
109                 Reference.reachabilityFence(this);
110                 if (ret >= 0 && ret <= 4096) { return null; }
111                 org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(null, ret); }
112                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
113                 return ret_hu_conv;
114         }
115
116 }