[Java] Properly convert strings to/from Modified UTF-8
[ldk-java] / src / main / java / org / ldk / structs / MultiThreadedScoreLock.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 locked `MultiThreadedLockableScore`.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class MultiThreadedScoreLock extends CommonBase {
16         MultiThreadedScoreLock(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.MultiThreadedScoreLock_free(ptr); }
21         }
22
23         /**
24          * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
25          */
26         public byte[] write() {
27                 byte[] ret = bindings.MultiThreadedScoreLock_write(this.ptr);
28                 Reference.reachabilityFence(this);
29                 return ret;
30         }
31
32         /**
33          * Constructs a new Score which calls the relevant methods on this_arg.
34          * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
35          */
36         public Score as_Score() {
37                 long ret = bindings.MultiThreadedScoreLock_as_Score(this.ptr);
38                 Reference.reachabilityFence(this);
39                 if (ret >= 0 && ret <= 4096) { return null; }
40                 Score ret_hu_conv = new Score(null, ret);
41                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
42                 return ret_hu_conv;
43         }
44
45 }