1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Invalid inbound onion payment.
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 {
20 if (ptr != 0) { bindings.InboundHTLCErr_free(ptr); }
26 public short get_err_code() {
27 short ret = bindings.InboundHTLCErr_get_err_code(this.ptr);
28 Reference.reachabilityFence(this);
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);
42 * Data attached to this error.
44 * Returns a copy of the field.
46 public byte[] get_err_data() {
47 byte[] ret = bindings.InboundHTLCErr_get_err_data(this.ptr);
48 Reference.reachabilityFence(this);
53 * Data attached to this error.
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);
64 public String get_msg() {
65 String ret = bindings.InboundHTLCErr_get_msg(this.ptr);
66 Reference.reachabilityFence(this);
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);
80 * Constructs a new InboundHTLCErr given each field
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); };