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