[Java] Update auto-generated Java bindings for 0.0.113
[ldk-java] / src / main / java / org / ldk / structs / Future.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 simple future which can complete once, and calls some callback(s) when it does so.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class Future extends CommonBase {
16         Future(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.Future_free(ptr); }
21         }
22
23         /**
24          * Registers a callback to be called upon completion of this future. If the future has already
25          * completed, the callback will be called immediately.
26          */
27         public void register_callback_fn(org.ldk.structs.FutureCallback callback) {
28                 bindings.Future_register_callback_fn(this.ptr, callback == null ? 0 : callback.ptr);
29                 Reference.reachabilityFence(this);
30                 Reference.reachabilityFence(callback);
31                 if (this != null) { this.ptrs_to.add(callback); };
32         }
33
34 }