]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java
Merge pull request #56 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / UpdateFailMalformedHTLC.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_malformed_htlc message to be sent or received from a peer
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class UpdateFailMalformedHTLC extends CommonBase {
15         UpdateFailMalformedHTLC(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); }
20         }
21
22         /**
23          * The channel ID
24          */
25         public byte[] get_channel_id() {
26                 byte[] ret = bindings.UpdateFailMalformedHTLC_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.UpdateFailMalformedHTLC_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.UpdateFailMalformedHTLC_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.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val);
50         }
51
52         /**
53          * The failure code
54          */
55         public short get_failure_code() {
56                 short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr);
57                 return ret;
58         }
59
60         /**
61          * The failure code
62          */
63         public void set_failure_code(short val) {
64                 bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val);
65         }
66
67         long clone_ptr() {
68                 long ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr);
69                 return ret;
70         }
71
72         /**
73          * Creates a copy of the UpdateFailMalformedHTLC
74          */
75         public UpdateFailMalformedHTLC clone() {
76                 long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr);
77                 if (ret >= 0 && ret <= 4096) { return null; }
78                 UpdateFailMalformedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFailMalformedHTLC(null, ret); }
79                 ret_hu_conv.ptrs_to.add(this);
80                 return ret_hu_conv;
81         }
82
83         /**
84          * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
85          */
86         public byte[] write() {
87                 byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr);
88                 return ret;
89         }
90
91         /**
92          * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
93          */
94         public static Result_UpdateFailMalformedHTLCDecodeErrorZ read(byte[] ser) {
95                 long ret = bindings.UpdateFailMalformedHTLC_read(ser);
96                 if (ret >= 0 && ret <= 4096) { return null; }
97                 Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
98                 return ret_hu_conv;
99         }
100
101 }