1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * A reply_short_channel_ids_end message is sent as a reply to a
13 * query_short_channel_ids message. The query recipient makes a best
14 * effort to respond based on their local network view which may not be
15 * a perfect view of the network.
17 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
18 public class ReplyShortChannelIdsEnd extends CommonBase {
19 ReplyShortChannelIdsEnd(Object _dummy, long ptr) { super(ptr); }
20 @Override @SuppressWarnings("deprecation")
21 protected void finalize() throws Throwable {
23 if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); }
27 * The genesis hash of the blockchain that was queried
29 public byte[] get_chain_hash() {
30 byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr);
31 Reference.reachabilityFence(this);
36 * The genesis hash of the blockchain that was queried
38 public void set_chain_hash(byte[] val) {
39 bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
40 Reference.reachabilityFence(this);
41 Reference.reachabilityFence(val);
45 * Indicates if the query recipient maintains up-to-date channel
46 * information for the chain_hash
48 public boolean get_full_information() {
49 boolean ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr);
50 Reference.reachabilityFence(this);
55 * Indicates if the query recipient maintains up-to-date channel
56 * information for the chain_hash
58 public void set_full_information(boolean val) {
59 bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val);
60 Reference.reachabilityFence(this);
61 Reference.reachabilityFence(val);
65 * Constructs a new ReplyShortChannelIdsEnd given each field
67 public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, boolean full_information_arg) {
68 long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.check_arr_len(chain_hash_arg, 32), full_information_arg);
69 Reference.reachabilityFence(chain_hash_arg);
70 Reference.reachabilityFence(full_information_arg);
71 if (ret >= 0 && ret <= 4096) { return null; }
72 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
73 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
78 long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr);
79 Reference.reachabilityFence(this);
84 * Creates a copy of the ReplyShortChannelIdsEnd
86 public ReplyShortChannelIdsEnd clone() {
87 long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
88 Reference.reachabilityFence(this);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
96 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
98 public byte[] write() {
99 byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
100 Reference.reachabilityFence(this);
105 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
107 public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
108 long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
109 Reference.reachabilityFence(ser);
110 if (ret >= 0 && ret <= 4096) { return null; }
111 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);