[Java] Update auto-generated bindings to 0.0.117
[ldk-java] / src / main / java / org / ldk / structs / Result_PayeePubKeySecp256k1ErrorZ.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 java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10 public class Result_PayeePubKeySecp256k1ErrorZ extends CommonBase {
11         private Result_PayeePubKeySecp256k1ErrorZ(Object _dummy, long ptr) { super(ptr); }
12         protected void finalize() throws Throwable {
13                 if (ptr != 0) { bindings.CResult_PayeePubKeySecp256k1ErrorZ_free(ptr); } super.finalize();
14         }
15
16         static Result_PayeePubKeySecp256k1ErrorZ constr_from_ptr(long ptr) {
17                 if (bindings.CResult_PayeePubKeySecp256k1ErrorZ_is_ok(ptr)) {
18                         return new Result_PayeePubKeySecp256k1ErrorZ_OK(null, ptr);
19                 } else {
20                         return new Result_PayeePubKeySecp256k1ErrorZ_Err(null, ptr);
21                 }
22         }
23         public static final class Result_PayeePubKeySecp256k1ErrorZ_OK extends Result_PayeePubKeySecp256k1ErrorZ {
24                 public final PayeePubKey res;
25                 private Result_PayeePubKeySecp256k1ErrorZ_OK(Object _dummy, long ptr) {
26                         super(_dummy, ptr);
27                         long res = bindings.CResult_PayeePubKeySecp256k1ErrorZ_get_ok(ptr);
28                         org.ldk.structs.PayeePubKey res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PayeePubKey(null, res); }
29                         if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); };
30                         this.res = res_hu_conv;
31                 }
32         }
33
34         public static final class Result_PayeePubKeySecp256k1ErrorZ_Err extends Result_PayeePubKeySecp256k1ErrorZ {
35                 public final Secp256k1Error err;
36                 private Result_PayeePubKeySecp256k1ErrorZ_Err(Object _dummy, long ptr) {
37                         super(_dummy, ptr);
38                         this.err = bindings.CResult_PayeePubKeySecp256k1ErrorZ_get_err(ptr);
39                 }
40         }
41
42         /**
43          * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
44          */
45         public static Result_PayeePubKeySecp256k1ErrorZ ok(org.ldk.structs.PayeePubKey o) {
46                 long ret = bindings.CResult_PayeePubKeySecp256k1ErrorZ_ok(o == null ? 0 : o.ptr);
47                 Reference.reachabilityFence(o);
48                 if (ret >= 0 && ret <= 4096) { return null; }
49                 Result_PayeePubKeySecp256k1ErrorZ ret_hu_conv = Result_PayeePubKeySecp256k1ErrorZ.constr_from_ptr(ret);
50                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); };
51                 return ret_hu_conv;
52         }
53
54         /**
55          * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
56          */
57         public static Result_PayeePubKeySecp256k1ErrorZ err(org.ldk.enums.Secp256k1Error e) {
58                 long ret = bindings.CResult_PayeePubKeySecp256k1ErrorZ_err(e);
59                 Reference.reachabilityFence(e);
60                 if (ret >= 0 && ret <= 4096) { return null; }
61                 Result_PayeePubKeySecp256k1ErrorZ ret_hu_conv = Result_PayeePubKeySecp256k1ErrorZ.constr_from_ptr(ret);
62                 return ret_hu_conv;
63         }
64
65         /**
66          * Checks if the given object is currently in the success state
67          */
68         public boolean is_ok() {
69                 boolean ret = bindings.CResult_PayeePubKeySecp256k1ErrorZ_is_ok(this.ptr);
70                 Reference.reachabilityFence(this);
71                 return ret;
72         }
73
74         long clone_ptr() {
75                 long ret = bindings.CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(this.ptr);
76                 Reference.reachabilityFence(this);
77                 return ret;
78         }
79
80         /**
81          * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
82          * but with all dynamically-allocated buffers duplicated in new buffers.
83          */
84         public Result_PayeePubKeySecp256k1ErrorZ clone() {
85                 long ret = bindings.CResult_PayeePubKeySecp256k1ErrorZ_clone(this.ptr);
86                 Reference.reachabilityFence(this);
87                 if (ret >= 0 && ret <= 4096) { return null; }
88                 Result_PayeePubKeySecp256k1ErrorZ ret_hu_conv = Result_PayeePubKeySecp256k1ErrorZ.constr_from_ptr(ret);
89                 return ret_hu_conv;
90         }
91
92 }