[Java] Update auto-generated Java bindings for 0.0.116
[ldk-java] / src / main / java / org / ldk / structs / BumpTransactionEventHandler.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 handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
13  * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
14  * Replace-By-Fee (RBF).
15  * 
16  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
17  */
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class BumpTransactionEventHandler extends CommonBase {
20         BumpTransactionEventHandler(Object _dummy, long ptr) { super(ptr); }
21         @Override @SuppressWarnings("deprecation")
22         protected void finalize() throws Throwable {
23                 super.finalize();
24                 if (ptr != 0) { bindings.BumpTransactionEventHandler_free(ptr); }
25         }
26
27         /**
28          * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
29          * 
30          * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
31          */
32         public static BumpTransactionEventHandler of(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.CoinSelectionSource utxo_source, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.Logger logger) {
33                 long ret = bindings.BumpTransactionEventHandler_new(broadcaster.ptr, utxo_source.ptr, signer_provider.ptr, logger.ptr);
34                 Reference.reachabilityFence(broadcaster);
35                 Reference.reachabilityFence(utxo_source);
36                 Reference.reachabilityFence(signer_provider);
37                 Reference.reachabilityFence(logger);
38                 if (ret >= 0 && ret <= 4096) { return null; }
39                 org.ldk.structs.BumpTransactionEventHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BumpTransactionEventHandler(null, ret); }
40                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
41                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(broadcaster); };
42                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(utxo_source); };
43                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(signer_provider); };
44                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
45                 return ret_hu_conv;
46         }
47
48         /**
49          * Handles all variants of [`BumpTransactionEvent`].
50          */
51         public void handle_event(org.ldk.structs.BumpTransactionEvent event) {
52                 bindings.BumpTransactionEventHandler_handle_event(this.ptr, event == null ? 0 : event.ptr);
53                 Reference.reachabilityFence(this);
54                 Reference.reachabilityFence(event);
55         }
56
57 }