[Java] Update auto-generated Java bindings to LDK 0.0.121
[ldk-java] / src / main / java / org / ldk / structs / InboundHTLCErr.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  * Invalid inbound onion payment.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class InboundHTLCErr extends CommonBase {
16         InboundHTLCErr(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.InboundHTLCErr_free(ptr); }
21         }
22
23         /**
24          * BOLT 4 error code.
25          */
26         public short get_err_code() {
27                 short ret = bindings.InboundHTLCErr_get_err_code(this.ptr);
28                 Reference.reachabilityFence(this);
29                 return ret;
30         }
31
32         /**
33          * BOLT 4 error code.
34          */
35         public void set_err_code(short val) {
36                 bindings.InboundHTLCErr_set_err_code(this.ptr, val);
37                 Reference.reachabilityFence(this);
38                 Reference.reachabilityFence(val);
39         }
40
41         /**
42          * Data attached to this error.
43          * 
44          * Returns a copy of the field.
45          */
46         public byte[] get_err_data() {
47                 byte[] ret = bindings.InboundHTLCErr_get_err_data(this.ptr);
48                 Reference.reachabilityFence(this);
49                 return ret;
50         }
51
52         /**
53          * Data attached to this error.
54          */
55         public void set_err_data(byte[] val) {
56                 bindings.InboundHTLCErr_set_err_data(this.ptr, val);
57                 Reference.reachabilityFence(this);
58                 Reference.reachabilityFence(val);
59         }
60
61         /**
62          * Error message text.
63          */
64         public String get_msg() {
65                 String ret = bindings.InboundHTLCErr_get_msg(this.ptr);
66                 Reference.reachabilityFence(this);
67                 return ret;
68         }
69
70         /**
71          * Error message text.
72          */
73         public void set_msg(java.lang.String val) {
74                 bindings.InboundHTLCErr_set_msg(this.ptr, val);
75                 Reference.reachabilityFence(this);
76                 Reference.reachabilityFence(val);
77         }
78
79         /**
80          * Constructs a new InboundHTLCErr given each field
81          */
82         public static InboundHTLCErr of(short err_code_arg, byte[] err_data_arg, java.lang.String msg_arg) {
83                 long ret = bindings.InboundHTLCErr_new(err_code_arg, err_data_arg, msg_arg);
84                 Reference.reachabilityFence(err_code_arg);
85                 Reference.reachabilityFence(err_data_arg);
86                 Reference.reachabilityFence(msg_arg);
87                 if (ret >= 0 && ret <= 4096) { return null; }
88                 org.ldk.structs.InboundHTLCErr ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InboundHTLCErr(null, ret); }
89                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
90                 return ret_hu_conv;
91         }
92
93 }