Update auto-generated bindings
[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         public long get_update_id() {
36                 long ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr);
37                 return ret;
38         }
39
40         /**
41          * The sequence number of this update. Updates *must* be replayed in-order according to this
42          * sequence number (and updates may panic if they are not). The update_id values are strictly
43          * increasing and increase by one for each new update, with one exception specified below.
44          * 
45          * This sequence number is also used to track up to which points updates which returned
46          * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
47          * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
48          * 
49          * The only instance where update_id values are not strictly increasing is the case where we
50          * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
51          * its docs for more details.
52          */
53         public void set_update_id(long val) {
54                 bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val);
55         }
56
57         /**
58          * Creates a copy of the ChannelMonitorUpdate
59          */
60         public ChannelMonitorUpdate clone() {
61                 long ret = bindings.ChannelMonitorUpdate_clone(this.ptr);
62                 ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret);
63                 ret_hu_conv.ptrs_to.add(this);
64                 return ret_hu_conv;
65         }
66
67         /**
68          * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
69          */
70         public byte[] write() {
71                 byte[] ret = bindings.ChannelMonitorUpdate_write(this.ptr);
72                 return ret;
73         }
74
75         /**
76          * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
77          */
78         public static Result_ChannelMonitorUpdateDecodeErrorZ read(byte[] ser) {
79                 long ret = bindings.ChannelMonitorUpdate_read(ser);
80                 Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
81                 return ret_hu_conv;
82         }
83
84 }