1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 public class Result_SignedRawInvoiceNoneZ extends CommonBase {
9 private Result_SignedRawInvoiceNoneZ(Object _dummy, long ptr) { super(ptr); }
10 protected void finalize() throws Throwable {
11 if (ptr != 0) { bindings.CResult_SignedRawInvoiceNoneZ_free(ptr); } super.finalize();
14 static Result_SignedRawInvoiceNoneZ constr_from_ptr(long ptr) {
15 if (bindings.LDKCResult_SignedRawInvoiceNoneZ_result_ok(ptr)) {
16 return new Result_SignedRawInvoiceNoneZ_OK(null, ptr);
18 return new Result_SignedRawInvoiceNoneZ_Err(null, ptr);
21 public static final class Result_SignedRawInvoiceNoneZ_OK extends Result_SignedRawInvoiceNoneZ {
22 public final SignedRawInvoice res;
23 private Result_SignedRawInvoiceNoneZ_OK(Object _dummy, long ptr) {
25 long res = bindings.LDKCResult_SignedRawInvoiceNoneZ_get_ok(ptr);
26 SignedRawInvoice res_hu_conv = new SignedRawInvoice(null, res);
27 res_hu_conv.ptrs_to.add(this);
28 this.res = res_hu_conv;
32 public static final class Result_SignedRawInvoiceNoneZ_Err extends Result_SignedRawInvoiceNoneZ {
33 private Result_SignedRawInvoiceNoneZ_Err(Object _dummy, long ptr) {
39 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
41 public static Result_SignedRawInvoiceNoneZ ok(SignedRawInvoice o) {
42 long ret = bindings.CResult_SignedRawInvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
43 Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
44 ret_hu_conv.ptrs_to.add(o);
49 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
51 public static Result_SignedRawInvoiceNoneZ err() {
52 long ret = bindings.CResult_SignedRawInvoiceNoneZ_err();
53 Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
58 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
59 * but with all dynamically-allocated buffers duplicated in new buffers.
61 public Result_SignedRawInvoiceNoneZ clone() {
62 long ret = bindings.CResult_SignedRawInvoiceNoneZ_clone(this.ptr);
63 Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);