1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class PeerHandleError extends CommonBase {
18 PeerHandleError(Object _dummy, long ptr) { super(ptr); }
19 @Override @SuppressWarnings("deprecation")
20 protected void finalize() throws Throwable {
22 if (ptr != 0) { bindings.PeerHandleError_free(ptr); }
26 * Constructs a new PeerHandleError given each field
28 public static PeerHandleError of() {
29 long ret = bindings.PeerHandleError_new();
30 if (ret >= 0 && ret <= 4096) { return null; }
31 org.ldk.structs.PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerHandleError(null, ret); }
32 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
37 long ret = bindings.PeerHandleError_clone_ptr(this.ptr);
38 Reference.reachabilityFence(this);
43 * Creates a copy of the PeerHandleError
45 public PeerHandleError clone() {
46 long ret = bindings.PeerHandleError_clone(this.ptr);
47 Reference.reachabilityFence(this);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 org.ldk.structs.PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerHandleError(null, ret); }
50 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
55 * Get the string representation of a PeerHandleError object
57 public String to_str() {
58 String ret = bindings.PeerHandleError_to_str(this.ptr);
59 Reference.reachabilityFence(this);