Update java bindings with new generator and new upstream code
[ldk-java] / src / main / java / org / ldk / structs / ChannelMonitorUpdate.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
9 /**
10  * An update generated by the underlying Channel itself which contains some new information the
11  * ChannelMonitor should be made aware of.
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class ChannelMonitorUpdate extends CommonBase {
15         ChannelMonitorUpdate(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.ChannelMonitorUpdate_free(ptr); }
20         }
21
22         /**
23          * The sequence number of this update. Updates *must* be replayed in-order according to this
24          * sequence number (and updates may panic if they are not). The update_id values are strictly
25          * increasing and increase by one for each new update, with one exception specified below.
26          * 
27          * This sequence number is also used to track up to which points updates which returned
28          * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
29          * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
30          * 
31          * The only instance where update_id values are not strictly increasing is the case where we
32          * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
33          * its docs for more details.
34          * 
35          * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
36          */
37         public long get_update_id() {
38                 long ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr);
39                 return ret;
40         }
41
42         /**
43          * The sequence number of this update. Updates *must* be replayed in-order according to this
44          * sequence number (and updates may panic if they are not). The update_id values are strictly
45          * increasing and increase by one for each new update, with one exception specified below.
46          * 
47          * This sequence number is also used to track up to which points updates which returned
48          * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
49          * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
50          * 
51          * The only instance where update_id values are not strictly increasing is the case where we
52          * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
53          * its docs for more details.
54          * 
55          * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
56          */
57         public void set_update_id(long val) {
58                 bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val);
59         }
60
61         /**
62          * Creates a copy of the ChannelMonitorUpdate
63          */
64         public ChannelMonitorUpdate clone() {
65                 long ret = bindings.ChannelMonitorUpdate_clone(this.ptr);
66                 ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret);
67                 ret_hu_conv.ptrs_to.add(this);
68                 return ret_hu_conv;
69         }
70
71         /**
72          * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
73          */
74         public byte[] write() {
75                 byte[] ret = bindings.ChannelMonitorUpdate_write(this.ptr);
76                 return ret;
77         }
78
79         /**
80          * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
81          */
82         public static Result_ChannelMonitorUpdateDecodeErrorZ constructor_read(byte[] ser) {
83                 long ret = bindings.ChannelMonitorUpdate_read(ser);
84                 Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
85                 return ret_hu_conv;
86         }
87
88 }