[Java] Update auto-generated Java bindings to LDK 0.0.121
[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  * 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  * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
18  */
19 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
20 public class ReplyShortChannelIdsEnd extends CommonBase {
21         ReplyShortChannelIdsEnd(Object _dummy, long ptr) { super(ptr); }
22         @Override @SuppressWarnings("deprecation")
23         protected void finalize() throws Throwable {
24                 super.finalize();
25                 if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); }
26         }
27
28         /**
29          * The genesis hash of the blockchain that was queried
30          */
31         public byte[] get_chain_hash() {
32                 byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr);
33                 Reference.reachabilityFence(this);
34                 return ret;
35         }
36
37         /**
38          * The genesis hash of the blockchain that was queried
39          */
40         public void set_chain_hash(byte[] val) {
41                 bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
42                 Reference.reachabilityFence(this);
43                 Reference.reachabilityFence(val);
44         }
45
46         /**
47          * Indicates if the query recipient maintains up-to-date channel
48          * information for the `chain_hash`
49          */
50         public boolean get_full_information() {
51                 boolean ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr);
52                 Reference.reachabilityFence(this);
53                 return ret;
54         }
55
56         /**
57          * Indicates if the query recipient maintains up-to-date channel
58          * information for the `chain_hash`
59          */
60         public void set_full_information(boolean val) {
61                 bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val);
62                 Reference.reachabilityFence(this);
63                 Reference.reachabilityFence(val);
64         }
65
66         /**
67          * Constructs a new ReplyShortChannelIdsEnd given each field
68          */
69         public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, boolean full_information_arg) {
70                 long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.check_arr_len(chain_hash_arg, 32), full_information_arg);
71                 Reference.reachabilityFence(chain_hash_arg);
72                 Reference.reachabilityFence(full_information_arg);
73                 if (ret >= 0 && ret <= 4096) { return null; }
74                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
75                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
76                 return ret_hu_conv;
77         }
78
79         long clone_ptr() {
80                 long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr);
81                 Reference.reachabilityFence(this);
82                 return ret;
83         }
84
85         /**
86          * Creates a copy of the ReplyShortChannelIdsEnd
87          */
88         public ReplyShortChannelIdsEnd clone() {
89                 long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
90                 Reference.reachabilityFence(this);
91                 if (ret >= 0 && ret <= 4096) { return null; }
92                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
93                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
94                 return ret_hu_conv;
95         }
96
97         /**
98          * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
99          */
100         public long hash() {
101                 long ret = bindings.ReplyShortChannelIdsEnd_hash(this.ptr);
102                 Reference.reachabilityFence(this);
103                 return ret;
104         }
105
106         @Override public int hashCode() {
107                 return (int)this.hash();
108         }
109         /**
110          * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
111          * This ignores pointers and is_owned flags and looks at the values in fields.
112          * Two objects with NULL inner values will be considered "equal" here.
113          */
114         public boolean eq(org.ldk.structs.ReplyShortChannelIdsEnd b) {
115                 boolean ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr);
116                 Reference.reachabilityFence(this);
117                 Reference.reachabilityFence(b);
118                 if (this != null) { this.ptrs_to.add(b); };
119                 return ret;
120         }
121
122         @Override public boolean equals(Object o) {
123                 if (!(o instanceof ReplyShortChannelIdsEnd)) return false;
124                 return this.eq((ReplyShortChannelIdsEnd)o);
125         }
126         /**
127          * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
128          */
129         public byte[] write() {
130                 byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
131                 Reference.reachabilityFence(this);
132                 return ret;
133         }
134
135         /**
136          * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
137          */
138         public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
139                 long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
140                 Reference.reachabilityFence(ser);
141                 if (ret >= 0 && ret <= 4096) { return null; }
142                 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
143                 return ret_hu_conv;
144         }
145
146 }