Update auto-generated bindings
[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 javax.annotation.Nullable;
8
9
10 /**
11  * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
12  * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
13  * descriptor.
14  */
15 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
16 public class PeerHandleError extends CommonBase {
17         PeerHandleError(Object _dummy, long ptr) { super(ptr); }
18         @Override @SuppressWarnings("deprecation")
19         protected void finalize() throws Throwable {
20                 super.finalize();
21                 if (ptr != 0) { bindings.PeerHandleError_free(ptr); }
22         }
23
24         /**
25          * Used to indicate that we probably can't make any future connections to this peer, implying
26          * we should go ahead and force-close any channels we have with it.
27          */
28         public boolean get_no_connection_possible() {
29                 boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr);
30                 return ret;
31         }
32
33         /**
34          * Used to indicate that we probably can't make any future connections to this peer, implying
35          * we should go ahead and force-close any channels we have with it.
36          */
37         public void set_no_connection_possible(boolean val) {
38                 bindings.PeerHandleError_set_no_connection_possible(this.ptr, val);
39         }
40
41         /**
42          * Constructs a new PeerHandleError given each field
43          */
44         public static PeerHandleError of(boolean no_connection_possible_arg) {
45                 long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
46                 if (ret >= 0 && ret <= 4096) { return null; }
47                 PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
48                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
49                 return ret_hu_conv;
50         }
51
52         long clone_ptr() {
53                 long ret = bindings.PeerHandleError_clone_ptr(this.ptr);
54                 return ret;
55         }
56
57         /**
58          * Creates a copy of the PeerHandleError
59          */
60         public PeerHandleError clone() {
61                 long ret = bindings.PeerHandleError_clone(this.ptr);
62                 if (ret >= 0 && ret <= 4096) { return null; }
63                 PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
64                 ret_hu_conv.ptrs_to.add(this);
65                 return ret_hu_conv;
66         }
67
68 }