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 bindings.HTLCFailChannelUpdate_free(ptr);
16 long conv_to_c() { assert false; return 0; /* Should only be called on subclasses */ }
17 static HTLCFailChannelUpdate constr_from_ptr(long ptr) {
18 bindings.LDKHTLCFailChannelUpdate raw_val = bindings.LDKHTLCFailChannelUpdate_ref_from_ptr(ptr);
19 if (raw_val.getClass() == bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage.class) {
20 return new ChannelUpdateMessage(ptr, (bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage)raw_val);
22 if (raw_val.getClass() == bindings.LDKHTLCFailChannelUpdate.ChannelClosed.class) {
23 return new ChannelClosed(ptr, (bindings.LDKHTLCFailChannelUpdate.ChannelClosed)raw_val);
25 if (raw_val.getClass() == bindings.LDKHTLCFailChannelUpdate.NodeFailure.class) {
26 return new NodeFailure(ptr, (bindings.LDKHTLCFailChannelUpdate.NodeFailure)raw_val);
28 assert false; return null; // Unreachable without extending the (internal) bindings interface
31 public final static class ChannelUpdateMessage extends HTLCFailChannelUpdate {
32 public ChannelUpdate msg;
33 private ChannelUpdateMessage(long ptr, bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage obj) {
36 ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
37 this.msg = msg_hu_conv;
39 @Override long conv_to_c() { return 0; /*XXX*/ }
41 public final static class ChannelClosed extends HTLCFailChannelUpdate {
42 public long short_channel_id;
43 public boolean is_permanent;
44 private ChannelClosed(long ptr, bindings.LDKHTLCFailChannelUpdate.ChannelClosed obj) {
46 this.short_channel_id = obj.short_channel_id;
47 this.is_permanent = obj.is_permanent;
49 @Override long conv_to_c() { return 0; /*XXX*/ }
51 public final static class NodeFailure extends HTLCFailChannelUpdate {
52 public byte[] node_id;
53 public boolean is_permanent;
54 private NodeFailure(long ptr, bindings.LDKHTLCFailChannelUpdate.NodeFailure obj) {
56 this.node_id = obj.node_id;
57 this.is_permanent = obj.is_permanent;
59 @Override long conv_to_c() { return 0; /*XXX*/ }