Update CI references to 0.0.122
[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 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * An Err type for failure to process messages.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class LightningError extends CommonBase {
16         LightningError(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.LightningError_free(ptr); }
21         }
22
23         /**
24          * A human-readable message describing the error
25          */
26         public String get_err() {
27                 String ret = bindings.LightningError_get_err(this.ptr);
28                 Reference.reachabilityFence(this);
29                 return ret;
30         }
31
32         /**
33          * A human-readable message describing the error
34          */
35         public void set_err(java.lang.String val) {
36                 bindings.LightningError_set_err(this.ptr, val);
37                 Reference.reachabilityFence(this);
38                 Reference.reachabilityFence(val);
39         }
40
41         /**
42          * The action which should be taken against the offending peer.
43          */
44         public ErrorAction get_action() {
45                 long ret = bindings.LightningError_get_action(this.ptr);
46                 Reference.reachabilityFence(this);
47                 if (ret >= 0 && ret <= 4096) { return null; }
48                 org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
49                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
50                 return ret_hu_conv;
51         }
52
53         /**
54          * The action which should be taken against the offending peer.
55          */
56         public void set_action(org.ldk.structs.ErrorAction val) {
57                 bindings.LightningError_set_action(this.ptr, val.ptr);
58                 Reference.reachabilityFence(this);
59                 Reference.reachabilityFence(val);
60                 if (this != null) { this.ptrs_to.add(val); };
61         }
62
63         /**
64          * Constructs a new LightningError given each field
65          */
66         public static LightningError of(java.lang.String err_arg, org.ldk.structs.ErrorAction action_arg) {
67                 long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
68                 Reference.reachabilityFence(err_arg);
69                 Reference.reachabilityFence(action_arg);
70                 if (ret >= 0 && ret <= 4096) { return null; }
71                 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
72                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
73                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(action_arg); };
74                 return ret_hu_conv;
75         }
76
77         long clone_ptr() {
78                 long ret = bindings.LightningError_clone_ptr(this.ptr);
79                 Reference.reachabilityFence(this);
80                 return ret;
81         }
82
83         /**
84          * Creates a copy of the LightningError
85          */
86         public LightningError clone() {
87                 long ret = bindings.LightningError_clone(this.ptr);
88                 Reference.reachabilityFence(this);
89                 if (ret >= 0 && ret <= 4096) { return null; }
90                 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
91                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
92                 return ret_hu_conv;
93         }
94
95 }