Update auto-generated 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 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         }
31
32         public static final class Result_SpendableOutputDescriptorDecodeErrorZ_Err extends Result_SpendableOutputDescriptorDecodeErrorZ {
33                 public final DecodeError err;
34                 private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
35                         super(_dummy, ptr);
36                         long err = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr);
37                         DecodeError err_hu_conv = new DecodeError(null, err);
38                         err_hu_conv.ptrs_to.add(this);
39                         this.err = err_hu_conv;
40                 }
41         }
42
43         /**
44          * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
45          */
46         public static Result_SpendableOutputDescriptorDecodeErrorZ constructor_ok(SpendableOutputDescriptor o) {
47                 long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o.ptr);
48                 Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
49                 return ret_hu_conv;
50         }
51
52         /**
53          * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
54          */
55         public static Result_SpendableOutputDescriptorDecodeErrorZ constructor_err(DecodeError e) {
56                 long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
57                 Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
58                 ret_hu_conv.ptrs_to.add(e);
59                 return ret_hu_conv;
60         }
61
62         /**
63          * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
64          * but with all dynamically-allocated buffers duplicated in new buffers.
65          */
66         public Result_SpendableOutputDescriptorDecodeErrorZ clone() {
67                 long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr);
68                 Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
69                 return ret_hu_conv;
70         }
71
72 }