1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * A channel_reestablish message to be sent or received from a peer
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 {
19 if (ptr != 0) { bindings.ChannelReestablish_free(ptr); }
25 public byte[] get_channel_id() {
26 byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr);
33 public void set_channel_id(byte[] val) {
34 bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
38 * The next commitment number for the sender
40 public long get_next_local_commitment_number() {
41 long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr);
46 * The next commitment number for the sender
48 public void set_next_local_commitment_number(long val) {
49 bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val);
53 * The next commitment number for the recipient
55 public long get_next_remote_commitment_number() {
56 long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr);
61 * The next commitment number for the recipient
63 public void set_next_remote_commitment_number(long val) {
64 bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val);
68 long ret = bindings.ChannelReestablish_clone_ptr(this.ptr);
73 * Creates a copy of the ChannelReestablish
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);
84 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
86 public byte[] write() {
87 byte[] ret = bindings.ChannelReestablish_write(this.ptr);
92 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
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);