]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/NetworkGraph.java
Fix race in tests
[ldk-java] / src / main / java / org / ldk / structs / NetworkGraph.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 NetworkGraph extends CommonBase {
10         NetworkGraph(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.NetworkGraph_free(ptr); }
15         }
16
17         public byte[] write(NetworkGraph obj) {
18                 byte[] ret = bindings.NetworkGraph_write(obj == null ? 0 : obj.ptr & ~1);
19                 this.ptrs_to.add(obj);
20                 return ret;
21         }
22
23         public static NetworkGraph constructor_read(byte[] ser) {
24                 long ret = bindings.NetworkGraph_read(ser);
25                 NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
26                 return ret_hu_conv;
27         }
28
29         public static NetworkGraph constructor_new() {
30                 long ret = bindings.NetworkGraph_new();
31                 NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
32                 return ret_hu_conv;
33         }
34
35         public void close_channel_from_update(long short_channel_id, boolean is_permanent) {
36                 bindings.NetworkGraph_close_channel_from_update(this.ptr, short_channel_id, is_permanent);
37         }
38
39 }