]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/MessageHandler.java
Fix race in tests
[ldk-java] / src / main / java / org / ldk / structs / MessageHandler.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 MessageHandler extends CommonBase {
10         MessageHandler(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.MessageHandler_free(ptr); }
15         }
16
17         public ChannelMessageHandler get_chan_handler() {
18                 long ret = bindings.MessageHandler_get_chan_handler(this.ptr);
19                 ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
20                 ret_hu_conv.ptrs_to.add(this);
21                 return ret_hu_conv;
22         }
23
24         public void set_chan_handler(ChannelMessageHandler val) {
25                 bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr);
26                 this.ptrs_to.add(val);
27         }
28
29         public RoutingMessageHandler get_route_handler() {
30                 long ret = bindings.MessageHandler_get_route_handler(this.ptr);
31                 RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
32                 ret_hu_conv.ptrs_to.add(this);
33                 return ret_hu_conv;
34         }
35
36         public void set_route_handler(RoutingMessageHandler val) {
37                 bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr);
38                 this.ptrs_to.add(val);
39         }
40
41         public static MessageHandler constructor_new(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg) {
42                 long ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr);
43                 MessageHandler ret_hu_conv = new MessageHandler(null, ret);
44                 ret_hu_conv.ptrs_to.add(chan_handler_arg);
45                 ret_hu_conv.ptrs_to.add(route_handler_arg);
46                 return ret_hu_conv;
47         }
48
49 }