[Java] Print error stack trace when tests fail
[ldk-java] / src / main / java / org / ldk / structs / Result_CVec_u8ZIOErrorZ.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 public class Result_CVec_u8ZIOErrorZ extends CommonBase {
11         private Result_CVec_u8ZIOErrorZ(Object _dummy, long ptr) { super(ptr); }
12         protected void finalize() throws Throwable {
13                 if (ptr != 0) { bindings.CResult_CVec_u8ZIOErrorZ_free(ptr); } super.finalize();
14         }
15
16         protected void force_free() {
17                 if (ptr != 0) { bindings.CResult_CVec_u8ZIOErrorZ_free(ptr); ptr = 0; }
18         }
19
20         static Result_CVec_u8ZIOErrorZ constr_from_ptr(long ptr) {
21                 if (bindings.CResult_CVec_u8ZIOErrorZ_is_ok(ptr)) {
22                         return new Result_CVec_u8ZIOErrorZ_OK(null, ptr);
23                 } else {
24                         return new Result_CVec_u8ZIOErrorZ_Err(null, ptr);
25                 }
26         }
27         public static final class Result_CVec_u8ZIOErrorZ_OK extends Result_CVec_u8ZIOErrorZ {
28                 public final byte[] res;
29                 private Result_CVec_u8ZIOErrorZ_OK(Object _dummy, long ptr) {
30                         super(_dummy, ptr);
31                         this.res = bindings.CResult_CVec_u8ZIOErrorZ_get_ok(ptr);
32                 }
33         }
34
35         public static final class Result_CVec_u8ZIOErrorZ_Err extends Result_CVec_u8ZIOErrorZ {
36                 public final IOError err;
37                 private Result_CVec_u8ZIOErrorZ_Err(Object _dummy, long ptr) {
38                         super(_dummy, ptr);
39                         this.err = bindings.CResult_CVec_u8ZIOErrorZ_get_err(ptr);
40                 }
41         }
42
43         /**
44          * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
45          */
46         public static Result_CVec_u8ZIOErrorZ ok(byte[] o) {
47                 long ret = bindings.CResult_CVec_u8ZIOErrorZ_ok(o);
48                 Reference.reachabilityFence(o);
49                 if (ret >= 0 && ret <= 4096) { return null; }
50                 Result_CVec_u8ZIOErrorZ ret_hu_conv = Result_CVec_u8ZIOErrorZ.constr_from_ptr(ret);
51                 return ret_hu_conv;
52         }
53
54         /**
55          * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
56          */
57         public static Result_CVec_u8ZIOErrorZ err(org.ldk.enums.IOError e) {
58                 long ret = bindings.CResult_CVec_u8ZIOErrorZ_err(e);
59                 Reference.reachabilityFence(e);
60                 if (ret >= 0 && ret <= 4096) { return null; }
61                 Result_CVec_u8ZIOErrorZ ret_hu_conv = Result_CVec_u8ZIOErrorZ.constr_from_ptr(ret);
62                 return ret_hu_conv;
63         }
64
65         /**
66          * Checks if the given object is currently in the success state
67          */
68         public boolean is_ok() {
69                 boolean ret = bindings.CResult_CVec_u8ZIOErrorZ_is_ok(this.ptr);
70                 Reference.reachabilityFence(this);
71                 return ret;
72         }
73
74         long clone_ptr() {
75                 long ret = bindings.CResult_CVec_u8ZIOErrorZ_clone_ptr(this.ptr);
76                 Reference.reachabilityFence(this);
77                 return ret;
78         }
79
80         /**
81          * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
82          * but with all dynamically-allocated buffers duplicated in new buffers.
83          */
84         public Result_CVec_u8ZIOErrorZ clone() {
85                 long ret = bindings.CResult_CVec_u8ZIOErrorZ_clone(this.ptr);
86                 Reference.reachabilityFence(this);
87                 if (ret >= 0 && ret <= 4096) { return null; }
88                 Result_CVec_u8ZIOErrorZ ret_hu_conv = Result_CVec_u8ZIOErrorZ.constr_from_ptr(ret);
89                 return ret_hu_conv;
90         }
91
92 }