Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / ReplyShortChannelIdsEnd.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 java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * A reply_short_channel_ids_end message is sent as a reply to a
13  * query_short_channel_ids message. The query recipient makes a best
14  * effort to respond based on their local network view which may not be
15  * a perfect view of the network.
16  */
17 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
18 public class ReplyShortChannelIdsEnd extends CommonBase {
19         ReplyShortChannelIdsEnd(Object _dummy, long ptr) { super(ptr); }
20         @Override @SuppressWarnings("deprecation")
21         protected void finalize() throws Throwable {
22                 super.finalize();
23                 if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); }
24         }
25
26         /**
27          * The genesis hash of the blockchain that was queried
28          */
29         public byte[] get_chain_hash() {
30                 byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr);
31                 Reference.reachabilityFence(this);
32                 return ret;
33         }
34
35         /**
36          * The genesis hash of the blockchain that was queried
37          */
38         public void set_chain_hash(byte[] val) {
39                 bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
40                 Reference.reachabilityFence(this);
41                 Reference.reachabilityFence(val);
42         }
43
44         /**
45          * Indicates if the query recipient maintains up-to-date channel
46          * information for the chain_hash
47          */
48         public boolean get_full_information() {
49                 boolean ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr);
50                 Reference.reachabilityFence(this);
51                 return ret;
52         }
53
54         /**
55          * Indicates if the query recipient maintains up-to-date channel
56          * information for the chain_hash
57          */
58         public void set_full_information(boolean val) {
59                 bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val);
60                 Reference.reachabilityFence(this);
61                 Reference.reachabilityFence(val);
62         }
63
64         /**
65          * Constructs a new ReplyShortChannelIdsEnd given each field
66          */
67         public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, boolean full_information_arg) {
68                 long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.check_arr_len(chain_hash_arg, 32), full_information_arg);
69                 Reference.reachabilityFence(chain_hash_arg);
70                 Reference.reachabilityFence(full_information_arg);
71                 if (ret >= 0 && ret <= 4096) { return null; }
72                 ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); }
73                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
74                 return ret_hu_conv;
75         }
76
77         long clone_ptr() {
78                 long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr);
79                 Reference.reachabilityFence(this);
80                 return ret;
81         }
82
83         /**
84          * Creates a copy of the ReplyShortChannelIdsEnd
85          */
86         public ReplyShortChannelIdsEnd clone() {
87                 long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
88                 Reference.reachabilityFence(this);
89                 if (ret >= 0 && ret <= 4096) { return null; }
90                 ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); }
91                 ret_hu_conv.ptrs_to.add(this);
92                 return ret_hu_conv;
93         }
94
95         /**
96          * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
97          */
98         public byte[] write() {
99                 byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
100                 Reference.reachabilityFence(this);
101                 return ret;
102         }
103
104         /**
105          * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
106          */
107         public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
108                 long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
109                 Reference.reachabilityFence(ser);
110                 if (ret >= 0 && ret <= 4096) { return null; }
111                 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
112                 return ret_hu_conv;
113         }
114
115 }