Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Result_CVec_SignatureZNoneZ.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 javax.annotation.Nullable;
8
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();
13         }
14
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);
18                 } else {
19                         return new Result_CVec_SignatureZNoneZ_Err(null, ptr);
20                 }
21         }
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) {
25                         super(_dummy, ptr);
26                         this.res = bindings.LDKCResult_CVec_SignatureZNoneZ_get_ok(ptr);
27                 }
28         }
29
30         public static final class Result_CVec_SignatureZNoneZ_Err extends Result_CVec_SignatureZNoneZ {
31                 private Result_CVec_SignatureZNoneZ_Err(Object _dummy, long ptr) {
32                         super(_dummy, ptr);
33                 }
34         }
35
36         /**
37          * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
38          */
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);
43                 return ret_hu_conv;
44         }
45
46         /**
47          * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
48          */
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);
53                 return ret_hu_conv;
54         }
55
56         /**
57          * Checks if the given object is currently in the success state
58          */
59         public boolean is_ok() {
60                 boolean ret = bindings.CResult_CVec_SignatureZNoneZ_is_ok(this.ptr);
61                 return ret;
62         }
63
64         long clone_ptr() {
65                 long ret = bindings.CResult_CVec_SignatureZNoneZ_clone_ptr(this.ptr);
66                 return ret;
67         }
68
69         /**
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.
72          */
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);
77                 return ret_hu_conv;
78         }
79
80 }