]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java
967d6bde89cd5bc5597c6c1308d3f0a89b1e0532
[ldk-java] / src / main / java / org / ldk / structs / Result_NodeAnnouncementInfoDecodeErrorZ.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_NodeAnnouncementInfoDecodeErrorZ extends CommonBase {
9         private Result_NodeAnnouncementInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
10         protected void finalize() throws Throwable {
11                 if (ptr != 0) { bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_free(ptr); } super.finalize();
12         }
13
14         static Result_NodeAnnouncementInfoDecodeErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(ptr)) {
16                         return new Result_NodeAnnouncementInfoDecodeErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_NodeAnnouncementInfoDecodeErrorZ_Err(null, ptr);
19                 }
20         }
21         public static final class Result_NodeAnnouncementInfoDecodeErrorZ_OK extends Result_NodeAnnouncementInfoDecodeErrorZ {
22                 public final NodeAnnouncementInfo res;
23                 private Result_NodeAnnouncementInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
24                         super(_dummy, ptr);
25                         long res = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr);
26                         NodeAnnouncementInfo res_hu_conv = new NodeAnnouncementInfo(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_NodeAnnouncementInfoDecodeErrorZ_Err extends Result_NodeAnnouncementInfoDecodeErrorZ {
33                 public final DecodeError err;
34                 private Result_NodeAnnouncementInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
35                         super(_dummy, ptr);
36                         long err = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_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_NodeAnnouncementInfoDecodeErrorZ in the success state.
45          */
46         public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_ok(NodeAnnouncementInfo o) {
47                 long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
48                 Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
49                 ret_hu_conv.ptrs_to.add(o);
50                 return ret_hu_conv;
51         }
52
53         /**
54          * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
55          */
56         public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_err(DecodeError e) {
57                 long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
58                 Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
59                 ret_hu_conv.ptrs_to.add(e);
60                 return ret_hu_conv;
61         }
62
63         /**
64          * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
65          * but with all dynamically-allocated buffers duplicated in new buffers.
66          */
67         public Result_NodeAnnouncementInfoDecodeErrorZ clone() {
68                 long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr);
69                 Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
70                 return ret_hu_conv;
71         }
72
73 }