1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class HTLCFailChannelUpdate extends CommonBase {
10 private HTLCFailChannelUpdate(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.HTLCFailChannelUpdate_free(ptr); }
16 static HTLCFailChannelUpdate constr_from_ptr(long ptr) {
17 bindings.LDKHTLCFailChannelUpdate raw_val = bindings.LDKHTLCFailChannelUpdate_ref_from_ptr(ptr);
18 if (raw_val.getClass() == bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage.class) {
19 return new ChannelUpdateMessage(ptr, (bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage)raw_val);
21 if (raw_val.getClass() == bindings.LDKHTLCFailChannelUpdate.ChannelClosed.class) {
22 return new ChannelClosed(ptr, (bindings.LDKHTLCFailChannelUpdate.ChannelClosed)raw_val);
24 if (raw_val.getClass() == bindings.LDKHTLCFailChannelUpdate.NodeFailure.class) {
25 return new NodeFailure(ptr, (bindings.LDKHTLCFailChannelUpdate.NodeFailure)raw_val);
27 assert false; return null; // Unreachable without extending the (internal) bindings interface
30 public final static class ChannelUpdateMessage extends HTLCFailChannelUpdate {
31 public final ChannelUpdate msg;
32 private ChannelUpdateMessage(long ptr, bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage obj) {
35 ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
36 this.msg = msg_hu_conv;
39 public final static class ChannelClosed extends HTLCFailChannelUpdate {
40 public final long short_channel_id;
41 public final boolean is_permanent;
42 private ChannelClosed(long ptr, bindings.LDKHTLCFailChannelUpdate.ChannelClosed obj) {
44 this.short_channel_id = obj.short_channel_id;
45 this.is_permanent = obj.is_permanent;
48 public final static class NodeFailure extends HTLCFailChannelUpdate {
49 public final byte[] node_id;
50 public final boolean is_permanent;
51 private NodeFailure(long ptr, bindings.LDKHTLCFailChannelUpdate.NodeFailure obj) {
53 this.node_id = obj.node_id;
54 this.is_permanent = obj.is_permanent;