3fd3ca6f8243ff95d36a05cd0ec40e22178cd63c
[ldk-java] / src / main / java / org / ldk / structs / Result_SpendableOutputDescriptorDecodeErrorZ.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8 public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase {
9         private Result_SpendableOutputDescriptorDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
10         protected void finalize() throws Throwable {
11                 if (ptr != 0) { bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_free(ptr); } super.finalize();
12         }
13
14         static Result_SpendableOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(ptr)) {
16                         return new Result_SpendableOutputDescriptorDecodeErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_SpendableOutputDescriptorDecodeErrorZ_Err(null, ptr);
19                 }
20         }
21         public static final class Result_SpendableOutputDescriptorDecodeErrorZ_OK extends Result_SpendableOutputDescriptorDecodeErrorZ {
22                 public final SpendableOutputDescriptor res;
23                 private Result_SpendableOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) {
24                         super(_dummy, ptr);
25                         long res = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(ptr);
26                         SpendableOutputDescriptor res_hu_conv = SpendableOutputDescriptor.constr_from_ptr(res);
27                         res_hu_conv.ptrs_to.add(this);
28                         this.res = res_hu_conv;
29                 }
30                 public Result_SpendableOutputDescriptorDecodeErrorZ_OK(SpendableOutputDescriptor res) {
31                         this(null, bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(res.ptr));
32                 }
33         }
34
35         public static final class Result_SpendableOutputDescriptorDecodeErrorZ_Err extends Result_SpendableOutputDescriptorDecodeErrorZ {
36                 public final DecodeError err;
37                 private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
38                         super(_dummy, ptr);
39                         long err = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr);
40                         DecodeError err_hu_conv = new DecodeError(null, err);
41                         err_hu_conv.ptrs_to.add(this);
42                         this.err = err_hu_conv;
43                 }
44                 public Result_SpendableOutputDescriptorDecodeErrorZ_Err(DecodeError err) {
45                         this(null, bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
46                         this.ptrs_to.add(err);
47                 }
48         }
49 }