| 5 | package engineering.lutris.datom; |
| 6 | |
| 7 | public class Fact implements AutoCloseable { |
| 8 | private static class JNI { |
| 9 | static { |
| 10 | DatomJNI.ensureLoaded(); |
| 11 | } |
| 12 | |
| 13 | private static native long fromEdn(String edn); |
| 14 | |
| 15 | private static native void destroy(long fact); |
| 16 | |
| 17 | private static native String toEdn(long fact); |
| 18 | } |
| 19 | |
| 20 | private long impl = 0; |
| 21 | |
| 22 | private Fact(long impl) { |
| 23 | this.impl = impl; |
| 24 | } |
| 25 | |
| 26 | public static Fact fromEdn(String edn) { |
| 27 | return new Fact(JNI.fromEdn(edn)); |
| 28 | } |
| 29 | |
| 30 | public String toEdn() { |
| 31 | return JNI.toEdn(this.impl); |
| 32 | } |
| 33 | |
| 34 | @Override |
| 35 | public void close() { |
| 36 | JNI.destroy(impl); |
| 37 | } |
| 38 | } |
nothing calls this directly
no outgoing calls
no test coverage detected