Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelReestablish.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 javax.annotation.Nullable;
8
9
10 /**
11  * A channel_reestablish message to be sent or received from a peer
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class ChannelReestablish extends CommonBase {
15         ChannelReestablish(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.ChannelReestablish_free(ptr); }
20         }
21
22         /**
23          * The channel ID
24          */
25         public byte[] get_channel_id() {
26                 byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr);
27                 return ret;
28         }
29
30         /**
31          * The channel ID
32          */
33         public void set_channel_id(byte[] val) {
34                 bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
35         }
36
37         /**
38          * The next commitment number for the sender
39          */
40         public long get_next_local_commitment_number() {
41                 long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr);
42                 return ret;
43         }
44
45         /**
46          * The next commitment number for the sender
47          */
48         public void set_next_local_commitment_number(long val) {
49                 bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val);
50         }
51
52         /**
53          * The next commitment number for the recipient
54          */
55         public long get_next_remote_commitment_number() {
56                 long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr);
57                 return ret;
58         }
59
60         /**
61          * The next commitment number for the recipient
62          */
63         public void set_next_remote_commitment_number(long val) {
64                 bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val);
65         }
66
67         long clone_ptr() {
68                 long ret = bindings.ChannelReestablish_clone_ptr(this.ptr);
69                 return ret;
70         }
71
72         /**
73          * Creates a copy of the ChannelReestablish
74          */
75         public ChannelReestablish clone() {
76                 long ret = bindings.ChannelReestablish_clone(this.ptr);
77                 if (ret >= 0 && ret <= 4096) { return null; }
78                 ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelReestablish(null, ret); }
79                 ret_hu_conv.ptrs_to.add(this);
80                 return ret_hu_conv;
81         }
82
83         /**
84          * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
85          */
86         public byte[] write() {
87                 byte[] ret = bindings.ChannelReestablish_write(this.ptr);
88                 return ret;
89         }
90
91         /**
92          * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
93          */
94         public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
95                 long ret = bindings.ChannelReestablish_read(ser);
96                 if (ret >= 0 && ret <= 4096) { return null; }
97                 Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
98                 return ret_hu_conv;
99         }
100
101 }