Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / UpdateAddHTLC.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 javax.annotation.Nullable;
8
9
10 /**
11  * An update_add_htlc message to be sent or received from a peer
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class UpdateAddHTLC extends CommonBase {
15         UpdateAddHTLC(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.UpdateAddHTLC_free(ptr); }
20         }
21
22         /**
23          * The channel ID
24          */
25         public byte[] get_channel_id() {
26                 byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr);
27                 return ret;
28         }
29
30         /**
31          * The channel ID
32          */
33         public void set_channel_id(byte[] val) {
34                 bindings.UpdateAddHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
35         }
36
37         /**
38          * The HTLC ID
39          */
40         public long get_htlc_id() {
41                 long ret = bindings.UpdateAddHTLC_get_htlc_id(this.ptr);
42                 return ret;
43         }
44
45         /**
46          * The HTLC ID
47          */
48         public void set_htlc_id(long val) {
49                 bindings.UpdateAddHTLC_set_htlc_id(this.ptr, val);
50         }
51
52         /**
53          * The HTLC value in milli-satoshi
54          */
55         public long get_amount_msat() {
56                 long ret = bindings.UpdateAddHTLC_get_amount_msat(this.ptr);
57                 return ret;
58         }
59
60         /**
61          * The HTLC value in milli-satoshi
62          */
63         public void set_amount_msat(long val) {
64                 bindings.UpdateAddHTLC_set_amount_msat(this.ptr, val);
65         }
66
67         /**
68          * The payment hash, the pre-image of which controls HTLC redemption
69          */
70         public byte[] get_payment_hash() {
71                 byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this.ptr);
72                 return ret;
73         }
74
75         /**
76          * The payment hash, the pre-image of which controls HTLC redemption
77          */
78         public void set_payment_hash(byte[] val) {
79                 bindings.UpdateAddHTLC_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
80         }
81
82         /**
83          * The expiry height of the HTLC
84          */
85         public int get_cltv_expiry() {
86                 int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr);
87                 return ret;
88         }
89
90         /**
91          * The expiry height of the HTLC
92          */
93         public void set_cltv_expiry(int val) {
94                 bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val);
95         }
96
97         long clone_ptr() {
98                 long ret = bindings.UpdateAddHTLC_clone_ptr(this.ptr);
99                 return ret;
100         }
101
102         /**
103          * Creates a copy of the UpdateAddHTLC
104          */
105         public UpdateAddHTLC clone() {
106                 long ret = bindings.UpdateAddHTLC_clone(this.ptr);
107                 if (ret >= 0 && ret <= 4096) { return null; }
108                 UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateAddHTLC(null, ret); }
109                 ret_hu_conv.ptrs_to.add(this);
110                 return ret_hu_conv;
111         }
112
113         /**
114          * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
115          */
116         public byte[] write() {
117                 byte[] ret = bindings.UpdateAddHTLC_write(this.ptr);
118                 return ret;
119         }
120
121         /**
122          * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
123          */
124         public static Result_UpdateAddHTLCDecodeErrorZ read(byte[] ser) {
125                 long ret = bindings.UpdateAddHTLC_read(ser);
126                 if (ret >= 0 && ret <= 4096) { return null; }
127                 Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
128                 return ret_hu_conv;
129         }
130
131 }