Updated bindings
[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 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase {
10         private Result_SpendableOutputDescriptorDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
11         protected void finalize() throws Throwable {
12                 if (ptr != 0) { bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_free(ptr); } super.finalize();
13         }
14
15         static Result_SpendableOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) {
16                 if (bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(ptr)) {
17                         return new Result_SpendableOutputDescriptorDecodeErrorZ_OK(null, ptr);
18                 } else {
19                         return new Result_SpendableOutputDescriptorDecodeErrorZ_Err(null, ptr);
20                 }
21         }
22         public static final class Result_SpendableOutputDescriptorDecodeErrorZ_OK extends Result_SpendableOutputDescriptorDecodeErrorZ {
23                 public final SpendableOutputDescriptor res;
24                 private Result_SpendableOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) {
25                         super(_dummy, ptr);
26                         long res = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(ptr);
27                         SpendableOutputDescriptor res_hu_conv = SpendableOutputDescriptor.constr_from_ptr(res);
28                         res_hu_conv.ptrs_to.add(this);
29                         this.res = res_hu_conv;
30                 }
31                 public Result_SpendableOutputDescriptorDecodeErrorZ_OK(SpendableOutputDescriptor res) {
32                         this(null, bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(res.ptr));
33                 }
34         }
35
36         public static final class Result_SpendableOutputDescriptorDecodeErrorZ_Err extends Result_SpendableOutputDescriptorDecodeErrorZ {
37                 public final DecodeError err;
38                 private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
39                         super(_dummy, ptr);
40                         long err = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr);
41                         DecodeError err_hu_conv = new DecodeError(null, err);
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 }