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 ErrorAction extends CommonBase {
10 private ErrorAction(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.ErrorAction_free(ptr); }
16 static ErrorAction constr_from_ptr(long ptr) {
17 bindings.LDKErrorAction raw_val = bindings.LDKErrorAction_ref_from_ptr(ptr);
18 if (raw_val.getClass() == bindings.LDKErrorAction.DisconnectPeer.class) {
19 return new DisconnectPeer(ptr, (bindings.LDKErrorAction.DisconnectPeer)raw_val);
21 if (raw_val.getClass() == bindings.LDKErrorAction.IgnoreError.class) {
22 return new IgnoreError(ptr, (bindings.LDKErrorAction.IgnoreError)raw_val);
24 if (raw_val.getClass() == bindings.LDKErrorAction.SendErrorMessage.class) {
25 return new SendErrorMessage(ptr, (bindings.LDKErrorAction.SendErrorMessage)raw_val);
27 assert false; return null; // Unreachable without extending the (internal) bindings interface
30 public final static class DisconnectPeer extends ErrorAction {
31 public final ErrorMessage msg;
32 private DisconnectPeer(long ptr, bindings.LDKErrorAction.DisconnectPeer obj) {
35 ErrorMessage msg_hu_conv = new ErrorMessage(null, msg);
36 this.msg = msg_hu_conv;
39 public final static class IgnoreError extends ErrorAction {
40 private IgnoreError(long ptr, bindings.LDKErrorAction.IgnoreError obj) {
44 public final static class SendErrorMessage extends ErrorAction {
45 public final ErrorMessage msg;
46 private SendErrorMessage(long ptr, bindings.LDKErrorAction.SendErrorMessage obj) {
49 ErrorMessage msg_hu_conv = new ErrorMessage(null, msg);
50 this.msg = msg_hu_conv;