1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * An Err type for failure to process messages.
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class LightningError extends CommonBase {
14 LightningError(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.LightningError_free(ptr); }
22 * A human-readable message describing the error
24 public String get_err() {
25 String ret = bindings.LightningError_get_err(this.ptr);
30 * A human-readable message describing the error
32 public void set_err(byte[] val) {
33 bindings.LightningError_set_err(this.ptr, val);
37 * The action which should be taken against the offending peer.
39 public ErrorAction get_action() {
40 long ret = bindings.LightningError_get_action(this.ptr);
41 ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
42 ret_hu_conv.ptrs_to.add(this);
47 * The action which should be taken against the offending peer.
49 public void set_action(ErrorAction val) {
50 bindings.LightningError_set_action(this.ptr, val.ptr);
54 * Constructs a new LightningError given each field
56 public static LightningError constructor_new(byte[] err_arg, ErrorAction action_arg) {
57 long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
58 LightningError ret_hu_conv = new LightningError(null, ret);
59 ret_hu_conv.ptrs_to.add(ret_hu_conv);
64 * Creates a copy of the LightningError
66 public LightningError clone() {
67 long ret = bindings.LightningError_clone(this.ptr);
68 LightningError ret_hu_conv = new LightningError(null, ret);
69 ret_hu_conv.ptrs_to.add(this);