[TS] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1
[ldk-java] / src / main / java / org / ldk / structs / Result_NoneBolt11SemanticErrorZ.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_NoneBolt11SemanticErrorZ extends CommonBase {
11         private Result_NoneBolt11SemanticErrorZ(Object _dummy, long ptr) { super(ptr); }
12         protected void finalize() throws Throwable {
13                 if (ptr != 0) { bindings.CResult_NoneBolt11SemanticErrorZ_free(ptr); } super.finalize();
14         }
15
16         protected void force_free() {
17                 if (ptr != 0) { bindings.CResult_NoneBolt11SemanticErrorZ_free(ptr); ptr = 0; }
18         }
19
20         static Result_NoneBolt11SemanticErrorZ constr_from_ptr(long ptr) {
21                 if (bindings.CResult_NoneBolt11SemanticErrorZ_is_ok(ptr)) {
22                         return new Result_NoneBolt11SemanticErrorZ_OK(null, ptr);
23                 } else {
24                         return new Result_NoneBolt11SemanticErrorZ_Err(null, ptr);
25                 }
26         }
27         public static final class Result_NoneBolt11SemanticErrorZ_OK extends Result_NoneBolt11SemanticErrorZ {
28                 private Result_NoneBolt11SemanticErrorZ_OK(Object _dummy, long ptr) {
29                         super(_dummy, ptr);
30                 }
31         }
32
33         public static final class Result_NoneBolt11SemanticErrorZ_Err extends Result_NoneBolt11SemanticErrorZ {
34                 public final Bolt11SemanticError err;
35                 private Result_NoneBolt11SemanticErrorZ_Err(Object _dummy, long ptr) {
36                         super(_dummy, ptr);
37                         this.err = bindings.CResult_NoneBolt11SemanticErrorZ_get_err(ptr);
38                 }
39         }
40
41         /**
42          * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
43          */
44         public static Result_NoneBolt11SemanticErrorZ ok() {
45                 long ret = bindings.CResult_NoneBolt11SemanticErrorZ_ok();
46                 if (ret >= 0 && ret <= 4096) { return null; }
47                 Result_NoneBolt11SemanticErrorZ ret_hu_conv = Result_NoneBolt11SemanticErrorZ.constr_from_ptr(ret);
48                 return ret_hu_conv;
49         }
50
51         /**
52          * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
53          */
54         public static Result_NoneBolt11SemanticErrorZ err(org.ldk.enums.Bolt11SemanticError e) {
55                 long ret = bindings.CResult_NoneBolt11SemanticErrorZ_err(e);
56                 Reference.reachabilityFence(e);
57                 if (ret >= 0 && ret <= 4096) { return null; }
58                 Result_NoneBolt11SemanticErrorZ ret_hu_conv = Result_NoneBolt11SemanticErrorZ.constr_from_ptr(ret);
59                 return ret_hu_conv;
60         }
61
62         /**
63          * Checks if the given object is currently in the success state
64          */
65         public boolean is_ok() {
66                 boolean ret = bindings.CResult_NoneBolt11SemanticErrorZ_is_ok(this.ptr);
67                 Reference.reachabilityFence(this);
68                 return ret;
69         }
70
71         long clone_ptr() {
72                 long ret = bindings.CResult_NoneBolt11SemanticErrorZ_clone_ptr(this.ptr);
73                 Reference.reachabilityFence(this);
74                 return ret;
75         }
76
77         /**
78          * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
79          * but with all dynamically-allocated buffers duplicated in new buffers.
80          */
81         public Result_NoneBolt11SemanticErrorZ clone() {
82                 long ret = bindings.CResult_NoneBolt11SemanticErrorZ_clone(this.ptr);
83                 Reference.reachabilityFence(this);
84                 if (ret >= 0 && ret <= 4096) { return null; }
85                 Result_NoneBolt11SemanticErrorZ ret_hu_conv = Result_NoneBolt11SemanticErrorZ.constr_from_ptr(ret);
86                 return ret_hu_conv;
87         }
88
89 }