Use AutoCloseable for structs named Locked*
[ldk-java] / src / main / java / org / ldk / structs / HTLCUpdate.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class HTLCUpdate extends CommonBase {
7         HTLCUpdate(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 super.finalize();
11                 bindings.HTLCUpdate_free(ptr);
12         }
13
14         public HTLCUpdate(HTLCUpdate orig) {
15                 super(bindings.HTLCUpdate_clone(orig == null ? 0 : orig.ptr & ~1));
16                 this.ptrs_to.add(orig);
17         }
18
19         // Skipped HTLCUpdate_write
20         public HTLCUpdate(byte[] ser) {
21                 super(bindings.HTLCUpdate_read(ser));
22         }
23
24 }