[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / UtxoFuture.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  * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
13  * 
14  * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
15  */
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class UtxoFuture extends CommonBase {
18         UtxoFuture(Object _dummy, long ptr) { super(ptr); }
19         @Override @SuppressWarnings("deprecation")
20         protected void finalize() throws Throwable {
21                 super.finalize();
22                 if (ptr != 0) { bindings.UtxoFuture_free(ptr); }
23         }
24
25         long clone_ptr() {
26                 long ret = bindings.UtxoFuture_clone_ptr(this.ptr);
27                 Reference.reachabilityFence(this);
28                 return ret;
29         }
30
31         /**
32          * Creates a copy of the UtxoFuture
33          */
34         public UtxoFuture clone() {
35                 long ret = bindings.UtxoFuture_clone(this.ptr);
36                 Reference.reachabilityFence(this);
37                 if (ret >= 0 && ret <= 4096) { return null; }
38                 org.ldk.structs.UtxoFuture ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UtxoFuture(null, ret); }
39                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
40                 return ret_hu_conv;
41         }
42
43         /**
44          * Builds a new future for later resolution.
45          */
46         public static UtxoFuture of() {
47                 long ret = bindings.UtxoFuture_new();
48                 if (ret >= 0 && ret <= 4096) { return null; }
49                 org.ldk.structs.UtxoFuture ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UtxoFuture(null, ret); }
50                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
51                 return ret_hu_conv;
52         }
53
54         /**
55          * Resolves this future against the given `graph` and with the given `result`.
56          * 
57          * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
58          * forwarding the validated gossip message onwards to peers.
59          * 
60          * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
61          * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
62          * after this.
63          * 
64          * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
65          * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
66          */
67         public void resolve_without_forwarding(org.ldk.structs.NetworkGraph graph, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) {
68                 bindings.UtxoFuture_resolve_without_forwarding(this.ptr, graph == null ? 0 : graph.ptr, result != null ? result.ptr : 0);
69                 Reference.reachabilityFence(this);
70                 Reference.reachabilityFence(graph);
71                 Reference.reachabilityFence(result);
72                 if (this != null) { this.ptrs_to.add(graph); };
73         }
74
75         /**
76          * Resolves this future against the given `graph` and with the given `result`.
77          * 
78          * The given `gossip` is used to broadcast any validated messages onwards to all peers which
79          * have available buffer space.
80          * 
81          * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
82          * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
83          * after this.
84          * 
85          * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
86          * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
87          */
88         public void resolve(org.ldk.structs.NetworkGraph graph, org.ldk.structs.P2PGossipSync gossip, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) {
89                 bindings.UtxoFuture_resolve(this.ptr, graph == null ? 0 : graph.ptr, gossip == null ? 0 : gossip.ptr, result != null ? result.ptr : 0);
90                 Reference.reachabilityFence(this);
91                 Reference.reachabilityFence(graph);
92                 Reference.reachabilityFence(gossip);
93                 Reference.reachabilityFence(result);
94                 if (this != null) { this.ptrs_to.add(graph); };
95                 if (this != null) { this.ptrs_to.add(gossip); };
96         }
97
98 }