1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class Result_NonePaymentSendFailureZ extends CommonBase {
10 private Result_NonePaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_NonePaymentSendFailureZ_free(ptr); } super.finalize();
15 static Result_NonePaymentSendFailureZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_NonePaymentSendFailureZ_result_ok(ptr)) {
17 return new Result_NonePaymentSendFailureZ_OK(null, ptr);
19 return new Result_NonePaymentSendFailureZ_Err(null, ptr);
22 public static final class Result_NonePaymentSendFailureZ_OK extends Result_NonePaymentSendFailureZ {
23 public final byte res;
24 private Result_NonePaymentSendFailureZ_OK(Object _dummy, long ptr) {
26 this.res = bindings.LDKCResult_NonePaymentSendFailureZ_get_ok(ptr);
28 public Result_NonePaymentSendFailureZ_OK() {
29 this(null, bindings.CResult_NonePaymentSendFailureZ_ok());
33 public static final class Result_NonePaymentSendFailureZ_Err extends Result_NonePaymentSendFailureZ {
34 public final PaymentSendFailure err;
35 private Result_NonePaymentSendFailureZ_Err(Object _dummy, long ptr) {
37 long err = bindings.LDKCResult_NonePaymentSendFailureZ_get_err(ptr);
38 PaymentSendFailure err_hu_conv = new PaymentSendFailure(null, err);
39 this.err = err_hu_conv;
41 public Result_NonePaymentSendFailureZ_Err(PaymentSendFailure err) {
42 this(null, bindings.CResult_NonePaymentSendFailureZ_err(err == null ? 0 : err.ptr & ~1));
43 this.ptrs_to.add(err);