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_TxOutAccessErrorZ extends CommonBase {
10 private Result_TxOutAccessErrorZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_TxOutAccessErrorZ_free(ptr); } super.finalize();
15 static Result_TxOutAccessErrorZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_TxOutAccessErrorZ_result_ok(ptr)) {
17 return new Result_TxOutAccessErrorZ_OK(null, ptr);
19 return new Result_TxOutAccessErrorZ_Err(null, ptr);
22 public static final class Result_TxOutAccessErrorZ_OK extends Result_TxOutAccessErrorZ {
23 public final TxOut res;
24 private Result_TxOutAccessErrorZ_OK(Object _dummy, long ptr) {
26 long res = bindings.LDKCResult_TxOutAccessErrorZ_get_ok(ptr);
27 TxOut res_conv = new TxOut(null, res);
30 public Result_TxOutAccessErrorZ_OK(TxOut res) {
31 this(null, bindings.CResult_TxOutAccessErrorZ_ok(res.ptr));
35 public static final class Result_TxOutAccessErrorZ_Err extends Result_TxOutAccessErrorZ {
36 public final LDKAccessError err;
37 private Result_TxOutAccessErrorZ_Err(Object _dummy, long ptr) {
39 this.err = bindings.LDKCResult_TxOutAccessErrorZ_get_err(ptr);
41 public Result_TxOutAccessErrorZ_Err(LDKAccessError err) {
42 this(null, bindings.CResult_TxOutAccessErrorZ_err(err));