1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * A channel_reestablish message to be sent or received from a peer
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class ChannelReestablish extends CommonBase {
14 ChannelReestablish(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.ChannelReestablish_free(ptr); }
24 public byte[] get_channel_id() {
25 byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr);
32 public void set_channel_id(byte[] val) {
33 bindings.ChannelReestablish_set_channel_id(this.ptr, val);
37 * The next commitment number for the sender
39 public long get_next_local_commitment_number() {
40 long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr);
45 * The next commitment number for the sender
47 public void set_next_local_commitment_number(long val) {
48 bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val);
52 * The next commitment number for the recipient
54 public long get_next_remote_commitment_number() {
55 long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr);
60 * The next commitment number for the recipient
62 public void set_next_remote_commitment_number(long val) {
63 bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val);
67 * Creates a copy of the ChannelReestablish
69 public ChannelReestablish clone() {
70 long ret = bindings.ChannelReestablish_clone(this.ptr);
71 ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret);
72 ret_hu_conv.ptrs_to.add(this);
77 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
79 public byte[] write() {
80 byte[] ret = bindings.ChannelReestablish_write(this.ptr);
85 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
87 public static Result_ChannelReestablishDecodeErrorZ constructor_read(byte[] ser) {
88 long ret = bindings.ChannelReestablish_read(ser);
89 Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);