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