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, val);
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 * Creates a copy of the ChannelReestablish
70 public ChannelReestablish clone() {
71 long ret = bindings.ChannelReestablish_clone(this.ptr);
72 if (ret < 1024) { return null; }
73 ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret);
74 ret_hu_conv.ptrs_to.add(this);
79 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
81 public byte[] write() {
82 byte[] ret = bindings.ChannelReestablish_write(this.ptr);
87 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
89 public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
90 long ret = bindings.ChannelReestablish_read(ser);
91 if (ret < 1024) { return null; }
92 Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);