Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / QueryShortChannelIds.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 query_short_channel_ids message is used to query a peer for
12  * routing gossip messages related to one or more short_channel_ids.
13  * The query recipient will reply with the latest, if available,
14  * channel_announcement, channel_update and node_announcement messages
15  * it maintains for the requested short_channel_ids followed by a
16  * reply_short_channel_ids_end message. The short_channel_ids sent in
17  * this query are encoded. We only support encoding_type=0 uncompressed
18  * serialization and do not support encoding_type=1 zlib serialization.
19  */
20 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
21 public class QueryShortChannelIds extends CommonBase {
22         QueryShortChannelIds(Object _dummy, long ptr) { super(ptr); }
23         @Override @SuppressWarnings("deprecation")
24         protected void finalize() throws Throwable {
25                 super.finalize();
26                 if (ptr != 0) { bindings.QueryShortChannelIds_free(ptr); }
27         }
28
29         /**
30          * The genesis hash of the blockchain being queried
31          */
32         public byte[] get_chain_hash() {
33                 byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr);
34                 return ret;
35         }
36
37         /**
38          * The genesis hash of the blockchain being queried
39          */
40         public void set_chain_hash(byte[] val) {
41                 bindings.QueryShortChannelIds_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
42         }
43
44         /**
45          * The short_channel_ids that are being queried
46          */
47         public void set_short_channel_ids(long[] val) {
48                 bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val);
49         }
50
51         /**
52          * Constructs a new QueryShortChannelIds given each field
53          */
54         public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
55                 long ret = bindings.QueryShortChannelIds_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_ids_arg);
56                 if (ret >= 0 && ret <= 4096) { return null; }
57                 QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); }
58                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
59                 return ret_hu_conv;
60         }
61
62         long clone_ptr() {
63                 long ret = bindings.QueryShortChannelIds_clone_ptr(this.ptr);
64                 return ret;
65         }
66
67         /**
68          * Creates a copy of the QueryShortChannelIds
69          */
70         public QueryShortChannelIds clone() {
71                 long ret = bindings.QueryShortChannelIds_clone(this.ptr);
72                 if (ret >= 0 && ret <= 4096) { return null; }
73                 QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); }
74                 ret_hu_conv.ptrs_to.add(this);
75                 return ret_hu_conv;
76         }
77
78         /**
79          * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
80          */
81         public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
82                 long ret = bindings.QueryShortChannelIds_read(ser);
83                 if (ret >= 0 && ret <= 4096) { return null; }
84                 Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
85                 return ret_hu_conv;
86         }
87
88         /**
89          * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
90          */
91         public byte[] write() {
92                 byte[] ret = bindings.QueryShortChannelIds_write(this.ptr);
93                 return ret;
94         }
95
96 }