[Java] Update auto-generated bindings to 0.0.117
[ldk-java] / src / main / java / org / ldk / structs / ScorerAccountingForInFlightHtlcs.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  * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
13  * 
14  * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
15  * [`find_route`].
16  * 
17  * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
18  */
19 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
20 public class ScorerAccountingForInFlightHtlcs extends CommonBase {
21         ScorerAccountingForInFlightHtlcs(Object _dummy, long ptr) { super(ptr); }
22         @Override @SuppressWarnings("deprecation")
23         protected void finalize() throws Throwable {
24                 super.finalize();
25                 if (ptr != 0) { bindings.ScorerAccountingForInFlightHtlcs_free(ptr); }
26         }
27
28         /**
29          * Initialize a new `ScorerAccountingForInFlightHtlcs`.
30          */
31         public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.ScoreLookUp scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) {
32                 long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr);
33                 Reference.reachabilityFence(scorer);
34                 Reference.reachabilityFence(inflight_htlcs);
35                 if (ret >= 0 && ret <= 4096) { return null; }
36                 org.ldk.structs.ScorerAccountingForInFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ScorerAccountingForInFlightHtlcs(null, ret); }
37                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
38                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); };
39                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inflight_htlcs); };
40                 return ret_hu_conv;
41         }
42
43         /**
44          * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
45          * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
46          */
47         public ScoreLookUp as_ScoreLookUp() {
48                 long ret = bindings.ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(this.ptr);
49                 Reference.reachabilityFence(this);
50                 if (ret >= 0 && ret <= 4096) { return null; }
51                 ScoreLookUp ret_hu_conv = new ScoreLookUp(null, ret);
52                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
53                 return ret_hu_conv;
54         }
55
56 }