Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ReplyChannelRange.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 reply_channel_range message is a reply to a query_channel_range
11  * message. Multiple reply_channel_range messages can be sent in reply
12  * to a single query_channel_range message. The query recipient makes a
13  * best effort to respond based on their local network view which may
14  * not be a perfect view of the network. The short_channel_ids in the
15  * reply are encoded. We only support encoding_type=0 uncompressed
16  * serialization and do not support encoding_type=1 zlib serialization.
17  */
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class ReplyChannelRange extends CommonBase {
20         ReplyChannelRange(Object _dummy, long ptr) { super(ptr); }
21         @Override @SuppressWarnings("deprecation")
22         protected void finalize() throws Throwable {
23                 super.finalize();
24                 if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); }
25         }
26
27         /**
28          * The genesis hash of the blockchain being queried
29          */
30         public byte[] get_chain_hash() {
31                 byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr);
32                 return ret;
33         }
34
35         /**
36          * The genesis hash of the blockchain being queried
37          */
38         public void set_chain_hash(byte[] val) {
39                 bindings.ReplyChannelRange_set_chain_hash(this.ptr, val);
40         }
41
42         /**
43          * The height of the first block in the range of the reply
44          */
45         public int get_first_blocknum() {
46                 int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr);
47                 return ret;
48         }
49
50         /**
51          * The height of the first block in the range of the reply
52          */
53         public void set_first_blocknum(int val) {
54                 bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val);
55         }
56
57         /**
58          * The number of blocks included in the range of the reply
59          */
60         public int get_number_of_blocks() {
61                 int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr);
62                 return ret;
63         }
64
65         /**
66          * The number of blocks included in the range of the reply
67          */
68         public void set_number_of_blocks(int val) {
69                 bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val);
70         }
71
72         /**
73          * True when this is the final reply for a query
74          */
75         public boolean get_sync_complete() {
76                 boolean ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr);
77                 return ret;
78         }
79
80         /**
81          * True when this is the final reply for a query
82          */
83         public void set_sync_complete(boolean val) {
84                 bindings.ReplyChannelRange_set_sync_complete(this.ptr, val);
85         }
86
87         /**
88          * The short_channel_ids in the channel range
89          */
90         public void set_short_channel_ids(long[] val) {
91                 bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val);
92         }
93
94         /**
95          * Constructs a new ReplyChannelRange given each field
96          */
97         public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) {
98                 long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
99                 ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
100                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
101                 return ret_hu_conv;
102         }
103
104         /**
105          * Creates a copy of the ReplyChannelRange
106          */
107         public ReplyChannelRange clone() {
108                 long ret = bindings.ReplyChannelRange_clone(this.ptr);
109                 ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
110                 ret_hu_conv.ptrs_to.add(this);
111                 return ret_hu_conv;
112         }
113
114         /**
115          * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
116          */
117         public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) {
118                 long ret = bindings.ReplyChannelRange_read(ser);
119                 Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
120                 return ret_hu_conv;
121         }
122
123         /**
124          * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
125          */
126         public byte[] write() {
127                 byte[] ret = bindings.ReplyChannelRange_write(this.ptr);
128                 return ret;
129         }
130
131 }