Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / LightningError.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8
9 /**
10  * An Err type for failure to process messages.
11  */
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 {
17                 super.finalize();
18                 if (ptr != 0) { bindings.LightningError_free(ptr); }
19         }
20
21         /**
22          * A human-readable message describing the error
23          */
24         public String get_err() {
25                 String ret = bindings.LightningError_get_err(this.ptr);
26                 return ret;
27         }
28
29         /**
30          * A human-readable message describing the error
31          */
32         public void set_err(String val) {
33                 bindings.LightningError_set_err(this.ptr, val);
34         }
35
36         /**
37          * The action which should be taken against the offending peer.
38          */
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);
43                 return ret_hu_conv;
44         }
45
46         /**
47          * The action which should be taken against the offending peer.
48          */
49         public void set_action(ErrorAction val) {
50                 bindings.LightningError_set_action(this.ptr, val.ptr);
51         }
52
53         /**
54          * Constructs a new LightningError given each field
55          */
56         public static LightningError of(String 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);
60                 return ret_hu_conv;
61         }
62
63         /**
64          * Creates a copy of the LightningError
65          */
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);
70                 return ret_hu_conv;
71         }
72
73 }