1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * An update_fail_malformed_htlc message to be sent or received from a peer
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 {
19 if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); }
25 public byte[] get_channel_id() {
26 byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr);
33 public void set_channel_id(byte[] val) {
34 bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
40 public long get_htlc_id() {
41 long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr);
48 public void set_htlc_id(long val) {
49 bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val);
55 public short get_failure_code() {
56 short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr);
63 public void set_failure_code(short val) {
64 bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val);
68 long ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr);
73 * Creates a copy of the UpdateFailMalformedHTLC
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);
84 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
86 public byte[] write() {
87 byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr);
92 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
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);