1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
9 public class Result_CVec_SignatureZNoneZ extends CommonBase {
10 private Result_CVec_SignatureZNoneZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_CVec_SignatureZNoneZ_free(ptr); } super.finalize();
15 static Result_CVec_SignatureZNoneZ constr_from_ptr(long ptr) {
16 if (bindings.CResult_CVec_SignatureZNoneZ_is_ok(ptr)) {
17 return new Result_CVec_SignatureZNoneZ_OK(null, ptr);
19 return new Result_CVec_SignatureZNoneZ_Err(null, ptr);
22 public static final class Result_CVec_SignatureZNoneZ_OK extends Result_CVec_SignatureZNoneZ {
23 public final byte[][] res;
24 private Result_CVec_SignatureZNoneZ_OK(Object _dummy, long ptr) {
26 this.res = bindings.LDKCResult_CVec_SignatureZNoneZ_get_ok(ptr);
30 public static final class Result_CVec_SignatureZNoneZ_Err extends Result_CVec_SignatureZNoneZ {
31 private Result_CVec_SignatureZNoneZ_Err(Object _dummy, long ptr) {
37 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
39 public static Result_CVec_SignatureZNoneZ ok(byte[][] o) {
40 long ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o != null ? Arrays.stream(o).map(o_conv_8 -> InternalUtils.check_arr_len(o_conv_8, 64)).toArray(byte[][]::new) : null);
41 if (ret >= 0 && ret <= 4096) { return null; }
42 Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
47 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
49 public static Result_CVec_SignatureZNoneZ err() {
50 long ret = bindings.CResult_CVec_SignatureZNoneZ_err();
51 if (ret >= 0 && ret <= 4096) { return null; }
52 Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
57 * Checks if the given object is currently in the success state
59 public boolean is_ok() {
60 boolean ret = bindings.CResult_CVec_SignatureZNoneZ_is_ok(this.ptr);
65 long ret = bindings.CResult_CVec_SignatureZNoneZ_clone_ptr(this.ptr);
70 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
71 * but with all dynamically-allocated buffers duplicated in new buffers.
73 public Result_CVec_SignatureZNoneZ clone() {
74 long ret = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr);
75 if (ret >= 0 && ret <= 4096) { return null; }
76 Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);