[Java] Update auto-generated bindings to 0.0.117
[ldk-java] / src / main / java / org / ldk / structs / FilesystemStore.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 [`KVStore`] implementation that writes to and reads from the file system.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class FilesystemStore extends CommonBase {
16         FilesystemStore(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.FilesystemStore_free(ptr); }
21         }
22
23         /**
24          * Constructs a new [`FilesystemStore`].
25          */
26         public static FilesystemStore of(java.lang.String data_dir) {
27                 long ret = bindings.FilesystemStore_new(data_dir);
28                 Reference.reachabilityFence(data_dir);
29                 if (ret >= 0 && ret <= 4096) { return null; }
30                 org.ldk.structs.FilesystemStore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FilesystemStore(null, ret); }
31                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
32                 return ret_hu_conv;
33         }
34
35         /**
36          * Returns the data directory.
37          */
38         public String get_data_dir() {
39                 String ret = bindings.FilesystemStore_get_data_dir(this.ptr);
40                 Reference.reachabilityFence(this);
41                 return ret;
42         }
43
44         /**
45          * Constructs a new KVStore which calls the relevant methods on this_arg.
46          * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
47          */
48         public KVStore as_KVStore() {
49                 long ret = bindings.FilesystemStore_as_KVStore(this.ptr);
50                 Reference.reachabilityFence(this);
51                 if (ret >= 0 && ret <= 4096) { return null; }
52                 KVStore ret_hu_conv = new KVStore(null, ret);
53                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
54                 return ret_hu_conv;
55         }
56
57 }