[Java] Update auto-generated Java bindings
[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                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
73                 if (ret_hu_conv != null) { 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                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
91                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
92                 return ret_hu_conv;
93         }
94
95         /**
96          * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
97          * This ignores pointers and is_owned flags and looks at the values in fields.
98          * Two objects with NULL inner values will be considered "equal" here.
99          */
100         public boolean eq(ReplyShortChannelIdsEnd b) {
101                 boolean ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr);
102                 Reference.reachabilityFence(this);
103                 Reference.reachabilityFence(b);
104                 if (this != null) { this.ptrs_to.add(b); };
105                 return ret;
106         }
107
108         @Override public boolean equals(Object o) {
109                 if (!(o instanceof ReplyShortChannelIdsEnd)) return false;
110                 return this.eq((ReplyShortChannelIdsEnd)o);
111         }
112         /**
113          * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
114          */
115         public byte[] write() {
116                 byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
117                 Reference.reachabilityFence(this);
118                 return ret;
119         }
120
121         /**
122          * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
123          */
124         public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
125                 long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
126                 Reference.reachabilityFence(ser);
127                 if (ret >= 0 && ret <= 4096) { return null; }
128                 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
129                 return ret_hu_conv;
130         }
131
132 }