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_PaymentIdPaymentSendFailureZ extends CommonBase {
10 private Result_PaymentIdPaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_PaymentIdPaymentSendFailureZ_free(ptr); } super.finalize();
15 static Result_PaymentIdPaymentSendFailureZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(ptr)) {
17 return new Result_PaymentIdPaymentSendFailureZ_OK(null, ptr);
19 return new Result_PaymentIdPaymentSendFailureZ_Err(null, ptr);
22 public static final class Result_PaymentIdPaymentSendFailureZ_OK extends Result_PaymentIdPaymentSendFailureZ {
23 public final byte[] res;
24 private Result_PaymentIdPaymentSendFailureZ_OK(Object _dummy, long ptr) {
26 this.res = bindings.LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(ptr);
30 public static final class Result_PaymentIdPaymentSendFailureZ_Err extends Result_PaymentIdPaymentSendFailureZ {
31 public final PaymentSendFailure err;
32 private Result_PaymentIdPaymentSendFailureZ_Err(Object _dummy, long ptr) {
34 long err = bindings.LDKCResult_PaymentIdPaymentSendFailureZ_get_err(ptr);
35 PaymentSendFailure err_hu_conv = PaymentSendFailure.constr_from_ptr(err);
36 err_hu_conv.ptrs_to.add(this);
37 this.err = err_hu_conv;
42 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
44 public static Result_PaymentIdPaymentSendFailureZ ok(byte[] o) {
45 long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(o);
46 if (ret >= 0 && ret <= 4096) { return null; }
47 Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
52 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
54 public static Result_PaymentIdPaymentSendFailureZ err(PaymentSendFailure e) {
55 long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_err(e.ptr);
56 if (ret >= 0 && ret <= 4096) { return null; }
57 Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
62 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
63 * but with all dynamically-allocated buffers duplicated in new buffers.
65 public Result_PaymentIdPaymentSendFailureZ clone() {
66 long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone(this.ptr);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);