[Java] 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 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                 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(ErrorAction val) {
57                 bindings.LightningError_set_action(this.ptr, val.ptr);
58                 Reference.reachabilityFence(this);
59                 Reference.reachabilityFence(val);
60         }
61
62         /**
63          * Constructs a new LightningError given each field
64          */
65         public static LightningError of(java.lang.String err_arg, ErrorAction action_arg) {
66                 long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
67                 Reference.reachabilityFence(err_arg);
68                 Reference.reachabilityFence(action_arg);
69                 if (ret >= 0 && ret <= 4096) { return null; }
70                 LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new LightningError(null, ret); }
71                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
72                 return ret_hu_conv;
73         }
74
75         long clone_ptr() {
76                 long ret = bindings.LightningError_clone_ptr(this.ptr);
77                 Reference.reachabilityFence(this);
78                 return ret;
79         }
80
81         /**
82          * Creates a copy of the LightningError
83          */
84         public LightningError clone() {
85                 long ret = bindings.LightningError_clone(this.ptr);
86                 Reference.reachabilityFence(this);
87                 if (ret >= 0 && ret <= 4096) { return null; }
88                 LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new LightningError(null, ret); }
89                 ret_hu_conv.ptrs_to.add(this);
90                 return ret_hu_conv;
91         }
92
93 }