1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
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 {
14 if (ptr != 0) { bindings.MessageHandler_free(ptr); }
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);
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);
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);
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);
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);