Update auto-generated bindings to 0.0.103
[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, val);
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(chain_hash_arg, 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         /**
63          * Creates a copy of the QueryShortChannelIds
64          */
65         public QueryShortChannelIds clone() {
66                 long ret = bindings.QueryShortChannelIds_clone(this.ptr);
67                 if (ret >= 0 && ret <= 4096) { return null; }
68                 QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); }
69                 ret_hu_conv.ptrs_to.add(this);
70                 return ret_hu_conv;
71         }
72
73         /**
74          * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
75          */
76         public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
77                 long ret = bindings.QueryShortChannelIds_read(ser);
78                 if (ret >= 0 && ret <= 4096) { return null; }
79                 Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
80                 return ret_hu_conv;
81         }
82
83         /**
84          * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
85          */
86         public byte[] write() {
87                 byte[] ret = bindings.QueryShortChannelIds_write(this.ptr);
88                 return ret;
89         }
90
91 }