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 import javax.annotation.Nullable;
8
9 public class Result_InvoiceNoneZ extends CommonBase {
10         private Result_InvoiceNoneZ(Object _dummy, long ptr) { super(ptr); }
11         protected void finalize() throws Throwable {
12                 if (ptr != 0) { bindings.CResult_InvoiceNoneZ_free(ptr); } super.finalize();
13         }
14
15         static Result_InvoiceNoneZ constr_from_ptr(long ptr) {
16                 if (bindings.CResult_InvoiceNoneZ_is_ok(ptr)) {
17                         return new Result_InvoiceNoneZ_OK(null, ptr);
18                 } else {
19                         return new Result_InvoiceNoneZ_Err(null, ptr);
20                 }
21         }
22         public static final class Result_InvoiceNoneZ_OK extends Result_InvoiceNoneZ {
23                 public final Invoice res;
24                 private Result_InvoiceNoneZ_OK(Object _dummy, long ptr) {
25                         super(_dummy, ptr);
26                         long res = bindings.LDKCResult_InvoiceNoneZ_get_ok(ptr);
27                         Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); }
28                         res_hu_conv.ptrs_to.add(this);
29                         this.res = res_hu_conv;
30                 }
31         }
32
33         public static final class Result_InvoiceNoneZ_Err extends Result_InvoiceNoneZ {
34                 private Result_InvoiceNoneZ_Err(Object _dummy, long ptr) {
35                         super(_dummy, ptr);
36                 }
37         }
38
39         /**
40          * Creates a new CResult_InvoiceNoneZ in the success state.
41          */
42         public static Result_InvoiceNoneZ ok(Invoice o) {
43                 long ret = bindings.CResult_InvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
44                 if (ret >= 0 && ret <= 4096) { return null; }
45                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
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 >= 0 && ret <= 4096) { return null; }
55                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
56                 return ret_hu_conv;
57         }
58
59         /**
60          * Checks if the given object is currently in the success state
61          */
62         public boolean is_ok() {
63                 boolean ret = bindings.CResult_InvoiceNoneZ_is_ok(this.ptr);
64                 return ret;
65         }
66
67         long clone_ptr() {
68                 long ret = bindings.CResult_InvoiceNoneZ_clone_ptr(this.ptr);
69                 return ret;
70         }
71
72         /**
73          * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
74          * but with all dynamically-allocated buffers duplicated in new buffers.
75          */
76         public Result_InvoiceNoneZ clone() {
77                 long ret = bindings.CResult_InvoiceNoneZ_clone(this.ptr);
78                 if (ret >= 0 && ret <= 4096) { return null; }
79                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
80                 return ret_hu_conv;
81         }
82
83 }