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 import javax.annotation.Nullable;
8
9
10 /**
11  * A reply_channel_range message is a reply to a query_channel_range
12  * message. Multiple reply_channel_range messages can be sent in reply
13  * to a single query_channel_range message. The query recipient makes a
14  * best effort to respond based on their local network view which may
15  * not be a perfect view of the network. The short_channel_ids in the
16  * reply 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 ReplyChannelRange extends CommonBase {
21         ReplyChannelRange(Object _dummy, long ptr) { super(ptr); }
22         @Override @SuppressWarnings("deprecation")
23         protected void finalize() throws Throwable {
24                 super.finalize();
25                 if (ptr != 0) { bindings.ReplyChannelRange_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.ReplyChannelRange_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.ReplyChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
41         }
42
43         /**
44          * The height of the first block in the range of the reply
45          */
46         public int get_first_blocknum() {
47                 int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr);
48                 return ret;
49         }
50
51         /**
52          * The height of the first block in the range of the reply
53          */
54         public void set_first_blocknum(int val) {
55                 bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val);
56         }
57
58         /**
59          * The number of blocks included in the range of the reply
60          */
61         public int get_number_of_blocks() {
62                 int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr);
63                 return ret;
64         }
65
66         /**
67          * The number of blocks included in the range of the reply
68          */
69         public void set_number_of_blocks(int val) {
70                 bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val);
71         }
72
73         /**
74          * True when this is the final reply for a query
75          */
76         public boolean get_sync_complete() {
77                 boolean ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr);
78                 return ret;
79         }
80
81         /**
82          * True when this is the final reply for a query
83          */
84         public void set_sync_complete(boolean val) {
85                 bindings.ReplyChannelRange_set_sync_complete(this.ptr, val);
86         }
87
88         /**
89          * The short_channel_ids in the channel range
90          */
91         public void set_short_channel_ids(long[] val) {
92                 bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val);
93         }
94
95         /**
96          * Constructs a new ReplyChannelRange given each field
97          */
98         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) {
99                 long ret = bindings.ReplyChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
100                 if (ret >= 0 && ret <= 4096) { return null; }
101                 ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); }
102                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
103                 return ret_hu_conv;
104         }
105
106         long clone_ptr() {
107                 long ret = bindings.ReplyChannelRange_clone_ptr(this.ptr);
108                 return ret;
109         }
110
111         /**
112          * Creates a copy of the ReplyChannelRange
113          */
114         public ReplyChannelRange clone() {
115                 long ret = bindings.ReplyChannelRange_clone(this.ptr);
116                 if (ret >= 0 && ret <= 4096) { return null; }
117                 ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); }
118                 ret_hu_conv.ptrs_to.add(this);
119                 return ret_hu_conv;
120         }
121
122         /**
123          * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
124          */
125         public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) {
126                 long ret = bindings.ReplyChannelRange_read(ser);
127                 if (ret >= 0 && ret <= 4096) { return null; }
128                 Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
129                 return ret_hu_conv;
130         }
131
132         /**
133          * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
134          */
135         public byte[] write() {
136                 byte[] ret = bindings.ReplyChannelRange_write(this.ptr);
137                 return ret;
138         }
139
140 }