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_htlc message to be sent or received from a peer
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 {
19 if (ptr != 0) { bindings.UpdateFailHTLC_free(ptr); }
25 public byte[] get_channel_id() {
26 byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this.ptr);
33 public void set_channel_id(byte[] val) {
34 bindings.UpdateFailHTLC_set_channel_id(this.ptr, val);
40 public long get_htlc_id() {
41 long ret = bindings.UpdateFailHTLC_get_htlc_id(this.ptr);
48 public void set_htlc_id(long val) {
49 bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val);
53 * Creates a copy of the UpdateFailHTLC
55 public UpdateFailHTLC clone() {
56 long ret = bindings.UpdateFailHTLC_clone(this.ptr);
57 if (ret < 1024) { return null; }
58 UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret);
59 ret_hu_conv.ptrs_to.add(this);
64 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
66 public byte[] write() {
67 byte[] ret = bindings.UpdateFailHTLC_write(this.ptr);
72 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
74 public static Result_UpdateFailHTLCDecodeErrorZ read(byte[] ser) {
75 long ret = bindings.UpdateFailHTLC_read(ser);
76 if (ret < 1024) { return null; }
77 Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);