]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java
Fix race in tests
[ldk-java] / src / main / java / org / ldk / structs / Result_RouteLightningErrorZ.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 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class Result_RouteLightningErrorZ extends CommonBase {
10         private Result_RouteLightningErrorZ(Object _dummy, long ptr) { super(ptr); }
11         protected void finalize() throws Throwable {
12                 if (ptr != 0) { bindings.CResult_RouteLightningErrorZ_free(ptr); } super.finalize();
13         }
14
15         static Result_RouteLightningErrorZ constr_from_ptr(long ptr) {
16                 if (bindings.LDKCResult_RouteLightningErrorZ_result_ok(ptr)) {
17                         return new Result_RouteLightningErrorZ_OK(null, ptr);
18                 } else {
19                         return new Result_RouteLightningErrorZ_Err(null, ptr);
20                 }
21         }
22         public static final class Result_RouteLightningErrorZ_OK extends Result_RouteLightningErrorZ {
23                 public final Route res;
24                 private Result_RouteLightningErrorZ_OK(Object _dummy, long ptr) {
25                         super(_dummy, ptr);
26                         long res = bindings.LDKCResult_RouteLightningErrorZ_get_ok(ptr);
27                         Route res_hu_conv = new Route(null, res);
28                         this.res = res_hu_conv;
29                 }
30                 public Result_RouteLightningErrorZ_OK(Route res) {
31                         this(null, bindings.CResult_RouteLightningErrorZ_ok(res == null ? 0 : res.ptr & ~1));
32                         this.ptrs_to.add(res);
33                 }
34         }
35
36         public static final class Result_RouteLightningErrorZ_Err extends Result_RouteLightningErrorZ {
37                 public final LightningError err;
38                 private Result_RouteLightningErrorZ_Err(Object _dummy, long ptr) {
39                         super(_dummy, ptr);
40                         long err = bindings.LDKCResult_RouteLightningErrorZ_get_err(ptr);
41                         LightningError err_hu_conv = new LightningError(null, err);
42                         this.err = err_hu_conv;
43                 }
44                 public Result_RouteLightningErrorZ_Err(LightningError err) {
45                         this(null, bindings.CResult_RouteLightningErrorZ_err(err == null ? 0 : err.ptr & ~1));
46                         this.ptrs_to.add(err);
47                 }
48         }
49 }