Update to support None
[ldk-java] / src / main / java / org / ldk / structs / ChannelMessageHandler.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4
5 import org.ldk.enums.*;
6
7 public class ChannelMessageHandler extends CommonBase {
8         ChannelMessageHandler(Object _dummy, long ptr) { super(ptr); }
9         public ChannelMessageHandler(bindings.LDKChannelMessageHandler arg, bindings.LDKMessageSendEventsProvider MessageSendEventsProvider) {
10                 super(bindings.LDKChannelMessageHandler_new(arg, MessageSendEventsProvider));
11                 this.ptrs_to.add(arg);
12         }
13         @Override @SuppressWarnings("deprecation")
14         protected void finalize() throws Throwable {
15                 bindings.ChannelMessageHandler_free(ptr); super.finalize();
16         }
17
18         public void call_handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) {
19                 bindings.ChannelMessageHandler_call_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
20                 this.ptrs_to.add(their_features);
21                 this.ptrs_to.add(msg);
22         }
23
24         public void call_handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) {
25                 bindings.ChannelMessageHandler_call_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
26                 this.ptrs_to.add(their_features);
27                 this.ptrs_to.add(msg);
28         }
29
30         public void call_handle_funding_created(byte[] their_node_id, FundingCreated msg) {
31                 bindings.ChannelMessageHandler_call_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
32                 this.ptrs_to.add(msg);
33         }
34
35         public void call_handle_funding_signed(byte[] their_node_id, FundingSigned msg) {
36                 bindings.ChannelMessageHandler_call_handle_funding_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
37                 this.ptrs_to.add(msg);
38         }
39
40         public void call_handle_funding_locked(byte[] their_node_id, FundingLocked msg) {
41                 bindings.ChannelMessageHandler_call_handle_funding_locked(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
42                 this.ptrs_to.add(msg);
43         }
44
45         public void call_handle_shutdown(byte[] their_node_id, Shutdown msg) {
46                 bindings.ChannelMessageHandler_call_handle_shutdown(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
47                 this.ptrs_to.add(msg);
48         }
49
50         public void call_handle_closing_signed(byte[] their_node_id, ClosingSigned msg) {
51                 bindings.ChannelMessageHandler_call_handle_closing_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
52                 this.ptrs_to.add(msg);
53         }
54
55         public void call_handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) {
56                 bindings.ChannelMessageHandler_call_handle_update_add_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
57                 this.ptrs_to.add(msg);
58         }
59
60         public void call_handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) {
61                 bindings.ChannelMessageHandler_call_handle_update_fulfill_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
62                 this.ptrs_to.add(msg);
63         }
64
65         public void call_handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) {
66                 bindings.ChannelMessageHandler_call_handle_update_fail_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
67                 this.ptrs_to.add(msg);
68         }
69
70         public void call_handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) {
71                 bindings.ChannelMessageHandler_call_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
72                 this.ptrs_to.add(msg);
73         }
74
75         public void call_handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) {
76                 bindings.ChannelMessageHandler_call_handle_commitment_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
77                 this.ptrs_to.add(msg);
78         }
79
80         public void call_handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) {
81                 bindings.ChannelMessageHandler_call_handle_revoke_and_ack(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
82                 this.ptrs_to.add(msg);
83         }
84
85         public void call_handle_update_fee(byte[] their_node_id, UpdateFee msg) {
86                 bindings.ChannelMessageHandler_call_handle_update_fee(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
87                 this.ptrs_to.add(msg);
88         }
89
90         public void call_handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) {
91                 bindings.ChannelMessageHandler_call_handle_announcement_signatures(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
92                 this.ptrs_to.add(msg);
93         }
94
95         public void call_peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
96                 bindings.ChannelMessageHandler_call_peer_disconnected(this.ptr, their_node_id, no_connection_possible);
97         }
98
99         public void call_peer_connected(byte[] their_node_id, Init msg) {
100                 bindings.ChannelMessageHandler_call_peer_connected(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
101                 this.ptrs_to.add(msg);
102         }
103
104         public void call_handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) {
105                 bindings.ChannelMessageHandler_call_handle_channel_reestablish(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
106                 this.ptrs_to.add(msg);
107         }
108
109         public void call_handle_error(byte[] their_node_id, ErrorMessage msg) {
110                 bindings.ChannelMessageHandler_call_handle_error(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
111                 this.ptrs_to.add(msg);
112         }
113
114 }