Update auto-generated bindings to 0.0.103
[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, val);
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         /**
68          * Creates a copy of the ChannelReestablish
69          */
70         public ChannelReestablish clone() {
71                 long ret = bindings.ChannelReestablish_clone(this.ptr);
72                 if (ret >= 0 && ret <= 4096) { return null; }
73                 ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelReestablish(null, ret); }
74                 ret_hu_conv.ptrs_to.add(this);
75                 return ret_hu_conv;
76         }
77
78         /**
79          * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
80          */
81         public byte[] write() {
82                 byte[] ret = bindings.ChannelReestablish_write(this.ptr);
83                 return ret;
84         }
85
86         /**
87          * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
88          */
89         public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
90                 long ret = bindings.ChannelReestablish_read(ser);
91                 if (ret >= 0 && ret <= 4096) { return null; }
92                 Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
93                 return ret_hu_conv;
94         }
95
96 }