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_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase {
9 private Result_StaticPaymentOutputDescriptorDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
10 protected void finalize() throws Throwable {
11 if (ptr != 0) { bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(ptr); } super.finalize();
14 static Result_StaticPaymentOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) {
15 if (bindings.LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(ptr)) {
16 return new Result_StaticPaymentOutputDescriptorDecodeErrorZ_OK(null, ptr);
18 return new Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(null, ptr);
21 public static final class Result_StaticPaymentOutputDescriptorDecodeErrorZ_OK extends Result_StaticPaymentOutputDescriptorDecodeErrorZ {
22 public final StaticPaymentOutputDescriptor res;
23 private Result_StaticPaymentOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) {
25 long res = bindings.LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(ptr);
26 StaticPaymentOutputDescriptor res_hu_conv = new StaticPaymentOutputDescriptor(null, res);
27 res_hu_conv.ptrs_to.add(this);
28 this.res = res_hu_conv;
32 public static final class Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err extends Result_StaticPaymentOutputDescriptorDecodeErrorZ {
33 public final DecodeError err;
34 private Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
36 long err = bindings.LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(ptr);
37 DecodeError err_hu_conv = new DecodeError(null, err);
38 err_hu_conv.ptrs_to.add(this);
39 this.err = err_hu_conv;
44 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
46 public static Result_StaticPaymentOutputDescriptorDecodeErrorZ ok(StaticPaymentOutputDescriptor o) {
47 long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
48 Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
49 ret_hu_conv.ptrs_to.add(o);
54 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
56 public static Result_StaticPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) {
57 long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
58 Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
59 ret_hu_conv.ptrs_to.add(e);
64 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
65 * but with all dynamically-allocated buffers duplicated in new buffers.
67 public Result_StaticPaymentOutputDescriptorDecodeErrorZ clone() {
68 long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr);
69 Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);