Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / UpdateFailHTLC.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_fail_htlc message to be sent or received from a peer
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class UpdateFailHTLC extends CommonBase {
15         UpdateFailHTLC(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.UpdateFailHTLC_free(ptr); }
20         }
21
22         /**
23          * The channel ID
24          */
25         public byte[] get_channel_id() {
26                 byte[] ret = bindings.UpdateFailHTLC_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.UpdateFailHTLC_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.UpdateFailHTLC_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.UpdateFailHTLC_set_htlc_id(this.ptr, val);
50         }
51
52         long clone_ptr() {
53                 long ret = bindings.UpdateFailHTLC_clone_ptr(this.ptr);
54                 return ret;
55         }
56
57         /**
58          * Creates a copy of the UpdateFailHTLC
59          */
60         public UpdateFailHTLC clone() {
61                 long ret = bindings.UpdateFailHTLC_clone(this.ptr);
62                 if (ret >= 0 && ret <= 4096) { return null; }
63                 UpdateFailHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFailHTLC(null, ret); }
64                 ret_hu_conv.ptrs_to.add(this);
65                 return ret_hu_conv;
66         }
67
68         /**
69          * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
70          */
71         public byte[] write() {
72                 byte[] ret = bindings.UpdateFailHTLC_write(this.ptr);
73                 return ret;
74         }
75
76         /**
77          * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
78          */
79         public static Result_UpdateFailHTLCDecodeErrorZ read(byte[] ser) {
80                 long ret = bindings.UpdateFailHTLC_read(ser);
81                 if (ret >= 0 && ret <= 4096) { return null; }
82                 Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
83                 return ret_hu_conv;
84         }
85
86 }