Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Result_InvoiceNoneZ.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_InvoiceNoneZ extends CommonBase {
9         private Result_InvoiceNoneZ(Object _dummy, long ptr) { super(ptr); }
10         protected void finalize() throws Throwable {
11                 if (ptr != 0) { bindings.CResult_InvoiceNoneZ_free(ptr); } super.finalize();
12         }
13
14         static Result_InvoiceNoneZ constr_from_ptr(long ptr) {
15                 if (bindings.LDKCResult_InvoiceNoneZ_result_ok(ptr)) {
16                         return new Result_InvoiceNoneZ_OK(null, ptr);
17                 } else {
18                         return new Result_InvoiceNoneZ_Err(null, ptr);
19                 }
20         }
21         public static final class Result_InvoiceNoneZ_OK extends Result_InvoiceNoneZ {
22                 public final Invoice res;
23                 private Result_InvoiceNoneZ_OK(Object _dummy, long ptr) {
24                         super(_dummy, ptr);
25                         long res = bindings.LDKCResult_InvoiceNoneZ_get_ok(ptr);
26                         Invoice res_hu_conv = new Invoice(null, res);
27                         res_hu_conv.ptrs_to.add(this);
28                         this.res = res_hu_conv;
29                 }
30         }
31
32         public static final class Result_InvoiceNoneZ_Err extends Result_InvoiceNoneZ {
33                 private Result_InvoiceNoneZ_Err(Object _dummy, long ptr) {
34                         super(_dummy, ptr);
35                 }
36         }
37
38         /**
39          * Creates a new CResult_InvoiceNoneZ in the success state.
40          */
41         public static Result_InvoiceNoneZ ok(Invoice o) {
42                 long ret = bindings.CResult_InvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
43                 if (ret < 1024) { return null; }
44                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
45                 ret_hu_conv.ptrs_to.add(o);
46                 return ret_hu_conv;
47         }
48
49         /**
50          * Creates a new CResult_InvoiceNoneZ in the error state.
51          */
52         public static Result_InvoiceNoneZ err() {
53                 long ret = bindings.CResult_InvoiceNoneZ_err();
54                 if (ret < 1024) { return null; }
55                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
56                 return ret_hu_conv;
57         }
58
59         /**
60          * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
61          * but with all dynamically-allocated buffers duplicated in new buffers.
62          */
63         public Result_InvoiceNoneZ clone() {
64                 long ret = bindings.CResult_InvoiceNoneZ_clone(this.ptr);
65                 if (ret < 1024) { return null; }
66                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
67                 return ret_hu_conv;
68         }
69
70 }