Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / PeerHandleError.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  * 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
14  * descriptor.
15  */
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 {
21                 super.finalize();
22                 if (ptr != 0) { bindings.PeerHandleError_free(ptr); }
23         }
24
25         /**
26          * Used to indicate that we probably can't make any future connections to this peer, implying
27          * we should go ahead and force-close any channels we have with it.
28          */
29         public boolean get_no_connection_possible() {
30                 boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr);
31                 Reference.reachabilityFence(this);
32                 return ret;
33         }
34
35         /**
36          * Used to indicate that we probably can't make any future connections to this peer, implying
37          * we should go ahead and force-close any channels we have with it.
38          */
39         public void set_no_connection_possible(boolean val) {
40                 bindings.PeerHandleError_set_no_connection_possible(this.ptr, val);
41                 Reference.reachabilityFence(this);
42                 Reference.reachabilityFence(val);
43         }
44
45         /**
46          * Constructs a new PeerHandleError given each field
47          */
48         public static PeerHandleError of(boolean no_connection_possible_arg) {
49                 long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
50                 Reference.reachabilityFence(no_connection_possible_arg);
51                 if (ret >= 0 && ret <= 4096) { return null; }
52                 PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
53                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
54                 return ret_hu_conv;
55         }
56
57         long clone_ptr() {
58                 long ret = bindings.PeerHandleError_clone_ptr(this.ptr);
59                 Reference.reachabilityFence(this);
60                 return ret;
61         }
62
63         /**
64          * Creates a copy of the PeerHandleError
65          */
66         public PeerHandleError clone() {
67                 long ret = bindings.PeerHandleError_clone(this.ptr);
68                 Reference.reachabilityFence(this);
69                 if (ret >= 0 && ret <= 4096) { return null; }
70                 PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
71                 ret_hu_conv.ptrs_to.add(this);
72                 return ret_hu_conv;
73         }
74
75 }