[Java] Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / MessageSendEvent.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 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
13  * broadcast to most peers).
14  * These events are handled by PeerManager::process_events if you are using a PeerManager.
15  */
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class MessageSendEvent extends CommonBase {
18         private MessageSendEvent(Object _dummy, long ptr) { super(ptr); }
19         @Override @SuppressWarnings("deprecation")
20         protected void finalize() throws Throwable {
21                 super.finalize();
22                 if (ptr != 0) { bindings.MessageSendEvent_free(ptr); }
23         }
24         static MessageSendEvent constr_from_ptr(long ptr) {
25                 bindings.LDKMessageSendEvent raw_val = bindings.LDKMessageSendEvent_ref_from_ptr(ptr);
26                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAcceptChannel.class) {
27                         return new SendAcceptChannel(ptr, (bindings.LDKMessageSendEvent.SendAcceptChannel)raw_val);
28                 }
29                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendOpenChannel.class) {
30                         return new SendOpenChannel(ptr, (bindings.LDKMessageSendEvent.SendOpenChannel)raw_val);
31                 }
32                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingCreated.class) {
33                         return new SendFundingCreated(ptr, (bindings.LDKMessageSendEvent.SendFundingCreated)raw_val);
34                 }
35                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingSigned.class) {
36                         return new SendFundingSigned(ptr, (bindings.LDKMessageSendEvent.SendFundingSigned)raw_val);
37                 }
38                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingLocked.class) {
39                         return new SendFundingLocked(ptr, (bindings.LDKMessageSendEvent.SendFundingLocked)raw_val);
40                 }
41                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAnnouncementSignatures.class) {
42                         return new SendAnnouncementSignatures(ptr, (bindings.LDKMessageSendEvent.SendAnnouncementSignatures)raw_val);
43                 }
44                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.UpdateHTLCs.class) {
45                         return new UpdateHTLCs(ptr, (bindings.LDKMessageSendEvent.UpdateHTLCs)raw_val);
46                 }
47                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendRevokeAndACK.class) {
48                         return new SendRevokeAndACK(ptr, (bindings.LDKMessageSendEvent.SendRevokeAndACK)raw_val);
49                 }
50                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendClosingSigned.class) {
51                         return new SendClosingSigned(ptr, (bindings.LDKMessageSendEvent.SendClosingSigned)raw_val);
52                 }
53                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShutdown.class) {
54                         return new SendShutdown(ptr, (bindings.LDKMessageSendEvent.SendShutdown)raw_val);
55                 }
56                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReestablish.class) {
57                         return new SendChannelReestablish(ptr, (bindings.LDKMessageSendEvent.SendChannelReestablish)raw_val);
58                 }
59                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement.class) {
60                         return new BroadcastChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement)raw_val);
61                 }
62                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement.class) {
63                         return new BroadcastNodeAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement)raw_val);
64                 }
65                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelUpdate.class) {
66                         return new BroadcastChannelUpdate(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelUpdate)raw_val);
67                 }
68                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelUpdate.class) {
69                         return new SendChannelUpdate(ptr, (bindings.LDKMessageSendEvent.SendChannelUpdate)raw_val);
70                 }
71                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.HandleError.class) {
72                         return new HandleError(ptr, (bindings.LDKMessageSendEvent.HandleError)raw_val);
73                 }
74                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) {
75                         return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val);
76                 }
77                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
78                         return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
79                 }
80                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
81                         return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
82                 }
83                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendGossipTimestampFilter.class) {
84                         return new SendGossipTimestampFilter(ptr, (bindings.LDKMessageSendEvent.SendGossipTimestampFilter)raw_val);
85                 }
86                 assert false; return null; // Unreachable without extending the (internal) bindings interface
87         }
88
89         /**
90          * Used to indicate that we've accepted a channel open and should send the accept_channel
91          * message provided to the given peer.
92          */
93         public final static class SendAcceptChannel extends MessageSendEvent {
94                 /**
95                  * The node_id of the node which should receive this message
96                 */
97                 public final byte[] node_id;
98                 /**
99                  * The message which should be sent.
100                 */
101                 public final org.ldk.structs.AcceptChannel msg;
102                 private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
103                         super(null, ptr);
104                         this.node_id = obj.node_id;
105                         long msg = obj.msg;
106                         AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); }
107                         msg_hu_conv.ptrs_to.add(this);
108                         this.msg = msg_hu_conv;
109                 }
110         }
111         /**
112          * Used to indicate that we've initiated a channel open and should send the open_channel
113          * message provided to the given peer.
114          */
115         public final static class SendOpenChannel extends MessageSendEvent {
116                 /**
117                  * The node_id of the node which should receive this message
118                 */
119                 public final byte[] node_id;
120                 /**
121                  * The message which should be sent.
122                 */
123                 public final org.ldk.structs.OpenChannel msg;
124                 private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
125                         super(null, ptr);
126                         this.node_id = obj.node_id;
127                         long msg = obj.msg;
128                         OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); }
129                         msg_hu_conv.ptrs_to.add(this);
130                         this.msg = msg_hu_conv;
131                 }
132         }
133         /**
134          * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
135          */
136         public final static class SendFundingCreated extends MessageSendEvent {
137                 /**
138                  * The node_id of the node which should receive this message
139                 */
140                 public final byte[] node_id;
141                 /**
142                  * The message which should be sent.
143                 */
144                 public final org.ldk.structs.FundingCreated msg;
145                 private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
146                         super(null, ptr);
147                         this.node_id = obj.node_id;
148                         long msg = obj.msg;
149                         FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); }
150                         msg_hu_conv.ptrs_to.add(this);
151                         this.msg = msg_hu_conv;
152                 }
153         }
154         /**
155          * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
156          */
157         public final static class SendFundingSigned extends MessageSendEvent {
158                 /**
159                  * The node_id of the node which should receive this message
160                 */
161                 public final byte[] node_id;
162                 /**
163                  * The message which should be sent.
164                 */
165                 public final org.ldk.structs.FundingSigned msg;
166                 private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
167                         super(null, ptr);
168                         this.node_id = obj.node_id;
169                         long msg = obj.msg;
170                         FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); }
171                         msg_hu_conv.ptrs_to.add(this);
172                         this.msg = msg_hu_conv;
173                 }
174         }
175         /**
176          * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
177          */
178         public final static class SendFundingLocked extends MessageSendEvent {
179                 /**
180                  * The node_id of the node which should receive these message(s)
181                 */
182                 public final byte[] node_id;
183                 /**
184                  * The funding_locked message which should be sent.
185                 */
186                 public final org.ldk.structs.FundingLocked msg;
187                 private SendFundingLocked(long ptr, bindings.LDKMessageSendEvent.SendFundingLocked obj) {
188                         super(null, ptr);
189                         this.node_id = obj.node_id;
190                         long msg = obj.msg;
191                         FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); }
192                         msg_hu_conv.ptrs_to.add(this);
193                         this.msg = msg_hu_conv;
194                 }
195         }
196         /**
197          * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
198          */
199         public final static class SendAnnouncementSignatures extends MessageSendEvent {
200                 /**
201                  * The node_id of the node which should receive these message(s)
202                 */
203                 public final byte[] node_id;
204                 /**
205                  * The announcement_signatures message which should be sent.
206                 */
207                 public final org.ldk.structs.AnnouncementSignatures msg;
208                 private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
209                         super(null, ptr);
210                         this.node_id = obj.node_id;
211                         long msg = obj.msg;
212                         AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); }
213                         msg_hu_conv.ptrs_to.add(this);
214                         this.msg = msg_hu_conv;
215                 }
216         }
217         /**
218          * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
219          * message should be sent to the peer with the given node_id.
220          */
221         public final static class UpdateHTLCs extends MessageSendEvent {
222                 /**
223                  * The node_id of the node which should receive these message(s)
224                 */
225                 public final byte[] node_id;
226                 /**
227                  * The update messages which should be sent. ALL messages in the struct should be sent!
228                 */
229                 public final org.ldk.structs.CommitmentUpdate updates;
230                 private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
231                         super(null, ptr);
232                         this.node_id = obj.node_id;
233                         long updates = obj.updates;
234                         CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new CommitmentUpdate(null, updates); }
235                         updates_hu_conv.ptrs_to.add(this);
236                         this.updates = updates_hu_conv;
237                 }
238         }
239         /**
240          * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
241          */
242         public final static class SendRevokeAndACK extends MessageSendEvent {
243                 /**
244                  * The node_id of the node which should receive this message
245                 */
246                 public final byte[] node_id;
247                 /**
248                  * The message which should be sent.
249                 */
250                 public final org.ldk.structs.RevokeAndACK msg;
251                 private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
252                         super(null, ptr);
253                         this.node_id = obj.node_id;
254                         long msg = obj.msg;
255                         RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); }
256                         msg_hu_conv.ptrs_to.add(this);
257                         this.msg = msg_hu_conv;
258                 }
259         }
260         /**
261          * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
262          */
263         public final static class SendClosingSigned extends MessageSendEvent {
264                 /**
265                  * The node_id of the node which should receive this message
266                 */
267                 public final byte[] node_id;
268                 /**
269                  * The message which should be sent.
270                 */
271                 public final org.ldk.structs.ClosingSigned msg;
272                 private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
273                         super(null, ptr);
274                         this.node_id = obj.node_id;
275                         long msg = obj.msg;
276                         ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); }
277                         msg_hu_conv.ptrs_to.add(this);
278                         this.msg = msg_hu_conv;
279                 }
280         }
281         /**
282          * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
283          */
284         public final static class SendShutdown extends MessageSendEvent {
285                 /**
286                  * The node_id of the node which should receive this message
287                 */
288                 public final byte[] node_id;
289                 /**
290                  * The message which should be sent.
291                 */
292                 public final org.ldk.structs.Shutdown msg;
293                 private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
294                         super(null, ptr);
295                         this.node_id = obj.node_id;
296                         long msg = obj.msg;
297                         Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); }
298                         msg_hu_conv.ptrs_to.add(this);
299                         this.msg = msg_hu_conv;
300                 }
301         }
302         /**
303          * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
304          */
305         public final static class SendChannelReestablish extends MessageSendEvent {
306                 /**
307                  * The node_id of the node which should receive this message
308                 */
309                 public final byte[] node_id;
310                 /**
311                  * The message which should be sent.
312                 */
313                 public final org.ldk.structs.ChannelReestablish msg;
314                 private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
315                         super(null, ptr);
316                         this.node_id = obj.node_id;
317                         long msg = obj.msg;
318                         ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); }
319                         msg_hu_conv.ptrs_to.add(this);
320                         this.msg = msg_hu_conv;
321                 }
322         }
323         /**
324          * Used to indicate that a channel_announcement and channel_update should be broadcast to all
325          * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
326          * 
327          * Note that after doing so, you very likely (unless you did so very recently) want to call
328          * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
329          * This ensures that any nodes which see our channel_announcement also have a relevant
330          * node_announcement, including relevant feature flags which may be important for routing
331          * through or to us.
332          */
333         public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
334                 /**
335                  * The channel_announcement which should be sent.
336                 */
337                 public final org.ldk.structs.ChannelAnnouncement msg;
338                 /**
339                  * The followup channel_update which should be sent.
340                 */
341                 public final org.ldk.structs.ChannelUpdate update_msg;
342                 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
343                         super(null, ptr);
344                         long msg = obj.msg;
345                         ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, msg); }
346                         msg_hu_conv.ptrs_to.add(this);
347                         this.msg = msg_hu_conv;
348                         long update_msg = obj.update_msg;
349                         ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new ChannelUpdate(null, update_msg); }
350                         update_msg_hu_conv.ptrs_to.add(this);
351                         this.update_msg = update_msg_hu_conv;
352                 }
353         }
354         /**
355          * Used to indicate that a node_announcement should be broadcast to all peers.
356          */
357         public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
358                 /**
359                  * The node_announcement which should be sent.
360                 */
361                 public final org.ldk.structs.NodeAnnouncement msg;
362                 private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
363                         super(null, ptr);
364                         long msg = obj.msg;
365                         NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, msg); }
366                         msg_hu_conv.ptrs_to.add(this);
367                         this.msg = msg_hu_conv;
368                 }
369         }
370         /**
371          * Used to indicate that a channel_update should be broadcast to all peers.
372          */
373         public final static class BroadcastChannelUpdate extends MessageSendEvent {
374                 /**
375                  * The channel_update which should be sent.
376                 */
377                 public final org.ldk.structs.ChannelUpdate msg;
378                 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
379                         super(null, ptr);
380                         long msg = obj.msg;
381                         ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
382                         msg_hu_conv.ptrs_to.add(this);
383                         this.msg = msg_hu_conv;
384                 }
385         }
386         /**
387          * Used to indicate that a channel_update should be sent to a single peer.
388          * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
389          * private channel and we shouldn't be informing all of our peers of channel parameters.
390          */
391         public final static class SendChannelUpdate extends MessageSendEvent {
392                 /**
393                  * The node_id of the node which should receive this message
394                 */
395                 public final byte[] node_id;
396                 /**
397                  * The channel_update which should be sent.
398                 */
399                 public final org.ldk.structs.ChannelUpdate msg;
400                 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
401                         super(null, ptr);
402                         this.node_id = obj.node_id;
403                         long msg = obj.msg;
404                         ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
405                         msg_hu_conv.ptrs_to.add(this);
406                         this.msg = msg_hu_conv;
407                 }
408         }
409         /**
410          * Broadcast an error downstream to be handled
411          */
412         public final static class HandleError extends MessageSendEvent {
413                 /**
414                  * The node_id of the node which should receive this message
415                 */
416                 public final byte[] node_id;
417                 /**
418                  * The action which should be taken.
419                 */
420                 public final org.ldk.structs.ErrorAction action;
421                 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
422                         super(null, ptr);
423                         this.node_id = obj.node_id;
424                         long action = obj.action;
425                         org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
426                         action_hu_conv.ptrs_to.add(this);
427                         this.action = action_hu_conv;
428                 }
429         }
430         /**
431          * Query a peer for channels with funding transaction UTXOs in a block range.
432          */
433         public final static class SendChannelRangeQuery extends MessageSendEvent {
434                 /**
435                  * The node_id of this message recipient
436                 */
437                 public final byte[] node_id;
438                 /**
439                  * The query_channel_range which should be sent.
440                 */
441                 public final org.ldk.structs.QueryChannelRange msg;
442                 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
443                         super(null, ptr);
444                         this.node_id = obj.node_id;
445                         long msg = obj.msg;
446                         QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); }
447                         msg_hu_conv.ptrs_to.add(this);
448                         this.msg = msg_hu_conv;
449                 }
450         }
451         /**
452          * Request routing gossip messages from a peer for a list of channels identified by
453          * their short_channel_ids.
454          */
455         public final static class SendShortIdsQuery extends MessageSendEvent {
456                 /**
457                  * The node_id of this message recipient
458                 */
459                 public final byte[] node_id;
460                 /**
461                  * The query_short_channel_ids which should be sent.
462                 */
463                 public final org.ldk.structs.QueryShortChannelIds msg;
464                 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
465                         super(null, ptr);
466                         this.node_id = obj.node_id;
467                         long msg = obj.msg;
468                         QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); }
469                         msg_hu_conv.ptrs_to.add(this);
470                         this.msg = msg_hu_conv;
471                 }
472         }
473         /**
474          * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
475          * emitted during processing of the query.
476          */
477         public final static class SendReplyChannelRange extends MessageSendEvent {
478                 /**
479                  * The node_id of this message recipient
480                 */
481                 public final byte[] node_id;
482                 /**
483                  * The reply_channel_range which should be sent.
484                 */
485                 public final org.ldk.structs.ReplyChannelRange msg;
486                 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
487                         super(null, ptr);
488                         this.node_id = obj.node_id;
489                         long msg = obj.msg;
490                         ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); }
491                         msg_hu_conv.ptrs_to.add(this);
492                         this.msg = msg_hu_conv;
493                 }
494         }
495         /**
496          * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
497          * enable receiving gossip messages from the peer.
498          */
499         public final static class SendGossipTimestampFilter extends MessageSendEvent {
500                 /**
501                  * The node_id of this message recipient
502                 */
503                 public final byte[] node_id;
504                 /**
505                  * The gossip_timestamp_filter which should be sent.
506                 */
507                 public final org.ldk.structs.GossipTimestampFilter msg;
508                 private SendGossipTimestampFilter(long ptr, bindings.LDKMessageSendEvent.SendGossipTimestampFilter obj) {
509                         super(null, ptr);
510                         this.node_id = obj.node_id;
511                         long msg = obj.msg;
512                         GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new GossipTimestampFilter(null, msg); }
513                         msg_hu_conv.ptrs_to.add(this);
514                         this.msg = msg_hu_conv;
515                 }
516         }
517         long clone_ptr() {
518                 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
519                 Reference.reachabilityFence(this);
520                 return ret;
521         }
522
523         /**
524          * Creates a copy of the MessageSendEvent
525          */
526         public MessageSendEvent clone() {
527                 long ret = bindings.MessageSendEvent_clone(this.ptr);
528                 Reference.reachabilityFence(this);
529                 if (ret >= 0 && ret <= 4096) { return null; }
530                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
531                 ret_hu_conv.ptrs_to.add(this);
532                 return ret_hu_conv;
533         }
534
535         /**
536          * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
537          */
538         public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
539                 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
540                 Reference.reachabilityFence(node_id);
541                 Reference.reachabilityFence(msg);
542                 if (ret >= 0 && ret <= 4096) { return null; }
543                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
544                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
545                 return ret_hu_conv;
546         }
547
548         /**
549          * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
550          */
551         public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
552                 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
553                 Reference.reachabilityFence(node_id);
554                 Reference.reachabilityFence(msg);
555                 if (ret >= 0 && ret <= 4096) { return null; }
556                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
557                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
558                 return ret_hu_conv;
559         }
560
561         /**
562          * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
563          */
564         public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
565                 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
566                 Reference.reachabilityFence(node_id);
567                 Reference.reachabilityFence(msg);
568                 if (ret >= 0 && ret <= 4096) { return null; }
569                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
570                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
571                 return ret_hu_conv;
572         }
573
574         /**
575          * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
576          */
577         public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
578                 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
579                 Reference.reachabilityFence(node_id);
580                 Reference.reachabilityFence(msg);
581                 if (ret >= 0 && ret <= 4096) { return null; }
582                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
583                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
584                 return ret_hu_conv;
585         }
586
587         /**
588          * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
589          */
590         public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) {
591                 long ret = bindings.MessageSendEvent_send_funding_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
592                 Reference.reachabilityFence(node_id);
593                 Reference.reachabilityFence(msg);
594                 if (ret >= 0 && ret <= 4096) { return null; }
595                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
596                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
597                 return ret_hu_conv;
598         }
599
600         /**
601          * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
602          */
603         public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
604                 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
605                 Reference.reachabilityFence(node_id);
606                 Reference.reachabilityFence(msg);
607                 if (ret >= 0 && ret <= 4096) { return null; }
608                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
609                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
610                 return ret_hu_conv;
611         }
612
613         /**
614          * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
615          */
616         public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
617                 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr & ~1);
618                 Reference.reachabilityFence(node_id);
619                 Reference.reachabilityFence(updates);
620                 if (ret >= 0 && ret <= 4096) { return null; }
621                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
622                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
623                 return ret_hu_conv;
624         }
625
626         /**
627          * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
628          */
629         public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
630                 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
631                 Reference.reachabilityFence(node_id);
632                 Reference.reachabilityFence(msg);
633                 if (ret >= 0 && ret <= 4096) { return null; }
634                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
635                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
636                 return ret_hu_conv;
637         }
638
639         /**
640          * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
641          */
642         public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
643                 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
644                 Reference.reachabilityFence(node_id);
645                 Reference.reachabilityFence(msg);
646                 if (ret >= 0 && ret <= 4096) { return null; }
647                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
648                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
649                 return ret_hu_conv;
650         }
651
652         /**
653          * Utility method to constructs a new SendShutdown-variant MessageSendEvent
654          */
655         public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
656                 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
657                 Reference.reachabilityFence(node_id);
658                 Reference.reachabilityFence(msg);
659                 if (ret >= 0 && ret <= 4096) { return null; }
660                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
661                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
662                 return ret_hu_conv;
663         }
664
665         /**
666          * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
667          */
668         public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
669                 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
670                 Reference.reachabilityFence(node_id);
671                 Reference.reachabilityFence(msg);
672                 if (ret >= 0 && ret <= 4096) { return null; }
673                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
674                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
675                 return ret_hu_conv;
676         }
677
678         /**
679          * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
680          */
681         public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
682                 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr & ~1, update_msg == null ? 0 : update_msg.ptr & ~1);
683                 Reference.reachabilityFence(msg);
684                 Reference.reachabilityFence(update_msg);
685                 if (ret >= 0 && ret <= 4096) { return null; }
686                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
687                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
688                 return ret_hu_conv;
689         }
690
691         /**
692          * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
693          */
694         public static MessageSendEvent broadcast_node_announcement(NodeAnnouncement msg) {
695                 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
696                 Reference.reachabilityFence(msg);
697                 if (ret >= 0 && ret <= 4096) { return null; }
698                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
699                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
700                 return ret_hu_conv;
701         }
702
703         /**
704          * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
705          */
706         public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
707                 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
708                 Reference.reachabilityFence(msg);
709                 if (ret >= 0 && ret <= 4096) { return null; }
710                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
711                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
712                 return ret_hu_conv;
713         }
714
715         /**
716          * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
717          */
718         public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
719                 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
720                 Reference.reachabilityFence(node_id);
721                 Reference.reachabilityFence(msg);
722                 if (ret >= 0 && ret <= 4096) { return null; }
723                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
724                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
725                 return ret_hu_conv;
726         }
727
728         /**
729          * Utility method to constructs a new HandleError-variant MessageSendEvent
730          */
731         public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
732                 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
733                 Reference.reachabilityFence(node_id);
734                 Reference.reachabilityFence(action);
735                 if (ret >= 0 && ret <= 4096) { return null; }
736                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
737                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
738                 return ret_hu_conv;
739         }
740
741         /**
742          * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
743          */
744         public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
745                 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
746                 Reference.reachabilityFence(node_id);
747                 Reference.reachabilityFence(msg);
748                 if (ret >= 0 && ret <= 4096) { return null; }
749                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
750                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
751                 return ret_hu_conv;
752         }
753
754         /**
755          * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
756          */
757         public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
758                 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
759                 Reference.reachabilityFence(node_id);
760                 Reference.reachabilityFence(msg);
761                 if (ret >= 0 && ret <= 4096) { return null; }
762                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
763                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
764                 return ret_hu_conv;
765         }
766
767         /**
768          * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
769          */
770         public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
771                 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
772                 Reference.reachabilityFence(node_id);
773                 Reference.reachabilityFence(msg);
774                 if (ret >= 0 && ret <= 4096) { return null; }
775                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
776                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
777                 return ret_hu_conv;
778         }
779
780         /**
781          * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
782          */
783         public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, GossipTimestampFilter msg) {
784                 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
785                 Reference.reachabilityFence(node_id);
786                 Reference.reachabilityFence(msg);
787                 if (ret >= 0 && ret <= 4096) { return null; }
788                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
789                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
790                 return ret_hu_conv;
791         }
792
793 }