1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
10 public class Result_CVec_StrZIOErrorZ extends CommonBase {
11 private Result_CVec_StrZIOErrorZ(Object _dummy, long ptr) { super(ptr); }
12 protected void finalize() throws Throwable {
13 if (ptr != 0) { bindings.CResult_CVec_StrZIOErrorZ_free(ptr); } super.finalize();
16 protected void force_free() {
17 if (ptr != 0) { bindings.CResult_CVec_StrZIOErrorZ_free(ptr); ptr = 0; }
20 static Result_CVec_StrZIOErrorZ constr_from_ptr(long ptr) {
21 if (bindings.CResult_CVec_StrZIOErrorZ_is_ok(ptr)) {
22 return new Result_CVec_StrZIOErrorZ_OK(null, ptr);
24 return new Result_CVec_StrZIOErrorZ_Err(null, ptr);
27 public static final class Result_CVec_StrZIOErrorZ_OK extends Result_CVec_StrZIOErrorZ {
28 public final String[] res;
29 private Result_CVec_StrZIOErrorZ_OK(Object _dummy, long ptr) {
31 this.res = bindings.CResult_CVec_StrZIOErrorZ_get_ok(ptr);
35 public static final class Result_CVec_StrZIOErrorZ_Err extends Result_CVec_StrZIOErrorZ {
36 public final IOError err;
37 private Result_CVec_StrZIOErrorZ_Err(Object _dummy, long ptr) {
39 this.err = bindings.CResult_CVec_StrZIOErrorZ_get_err(ptr);
44 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
46 public static Result_CVec_StrZIOErrorZ ok(String[] o) {
47 long ret = bindings.CResult_CVec_StrZIOErrorZ_ok(o);
48 Reference.reachabilityFence(o);
49 if (ret >= 0 && ret <= 4096) { return null; }
50 Result_CVec_StrZIOErrorZ ret_hu_conv = Result_CVec_StrZIOErrorZ.constr_from_ptr(ret);
55 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
57 public static Result_CVec_StrZIOErrorZ err(org.ldk.enums.IOError e) {
58 long ret = bindings.CResult_CVec_StrZIOErrorZ_err(e);
59 Reference.reachabilityFence(e);
60 if (ret >= 0 && ret <= 4096) { return null; }
61 Result_CVec_StrZIOErrorZ ret_hu_conv = Result_CVec_StrZIOErrorZ.constr_from_ptr(ret);
66 * Checks if the given object is currently in the success state
68 public boolean is_ok() {
69 boolean ret = bindings.CResult_CVec_StrZIOErrorZ_is_ok(this.ptr);
70 Reference.reachabilityFence(this);
75 long ret = bindings.CResult_CVec_StrZIOErrorZ_clone_ptr(this.ptr);
76 Reference.reachabilityFence(this);
81 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
82 * but with all dynamically-allocated buffers duplicated in new buffers.
84 public Result_CVec_StrZIOErrorZ clone() {
85 long ret = bindings.CResult_CVec_StrZIOErrorZ_clone(this.ptr);
86 Reference.reachabilityFence(this);
87 if (ret >= 0 && ret <= 4096) { return null; }
88 Result_CVec_StrZIOErrorZ ret_hu_conv = Result_CVec_StrZIOErrorZ.constr_from_ptr(ret);