[Java] Update auto-generated Java bindings for 0.0.113
[ldk-java] / src / main / java / org / ldk / structs / MultiThreadedLockableScore.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 concrete implementation of [`LockableScore`] which supports multi-threading.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class MultiThreadedLockableScore extends CommonBase {
16         MultiThreadedLockableScore(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.MultiThreadedLockableScore_free(ptr); }
21         }
22
23         /**
24          * Constructs a new LockableScore which calls the relevant methods on this_arg.
25          * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
26          */
27         public LockableScore as_LockableScore() {
28                 long ret = bindings.MultiThreadedLockableScore_as_LockableScore(this.ptr);
29                 Reference.reachabilityFence(this);
30                 if (ret >= 0 && ret <= 4096) { return null; }
31                 LockableScore ret_hu_conv = new LockableScore(null, ret);
32                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
33                 return ret_hu_conv;
34         }
35
36         /**
37          * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
38          */
39         public byte[] write() {
40                 byte[] ret = bindings.MultiThreadedLockableScore_write(this.ptr);
41                 Reference.reachabilityFence(this);
42                 return ret;
43         }
44
45         /**
46          * Constructs a new WriteableScore which calls the relevant methods on this_arg.
47          * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
48          */
49         public WriteableScore as_WriteableScore() {
50                 long ret = bindings.MultiThreadedLockableScore_as_WriteableScore(this.ptr);
51                 Reference.reachabilityFence(this);
52                 if (ret >= 0 && ret <= 4096) { return null; }
53                 WriteableScore ret_hu_conv = new WriteableScore(null, ret);
54                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
55                 return ret_hu_conv;
56         }
57
58         /**
59          * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
60          */
61         public static MultiThreadedLockableScore of(org.ldk.structs.Score score) {
62                 long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr);
63                 Reference.reachabilityFence(score);
64                 if (ret >= 0 && ret <= 4096) { return null; }
65                 org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); }
66                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
67                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(score); };
68                 return ret_hu_conv;
69         }
70
71 }