Use AutoCloseable for structs named Locked*
[ldk-java] / src / main / java / org / ldk / structs / OutPoint.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class OutPoint extends CommonBase {
7         OutPoint(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 super.finalize();
11                 bindings.OutPoint_free(ptr);
12         }
13
14         public OutPoint(OutPoint orig) {
15                 super(bindings.OutPoint_clone(orig == null ? 0 : orig.ptr & ~1));
16                 this.ptrs_to.add(orig);
17         }
18
19         public byte[] get_txid(OutPoint this_ptr) {
20                 byte[] ret = bindings.OutPoint_get_txid(this_ptr == null ? 0 : this_ptr.ptr & ~1);
21                 this.ptrs_to.add(this_ptr);
22                 return ret;
23         }
24
25         public void set_txid(OutPoint this_ptr, byte[] val) {
26                 bindings.OutPoint_set_txid(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
27                 this.ptrs_to.add(this_ptr);
28         }
29
30         public short get_index(OutPoint this_ptr) {
31                 short ret = bindings.OutPoint_get_index(this_ptr == null ? 0 : this_ptr.ptr & ~1);
32                 this.ptrs_to.add(this_ptr);
33                 return ret;
34         }
35
36         public void set_index(OutPoint this_ptr, short val) {
37                 bindings.OutPoint_set_index(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
38                 this.ptrs_to.add(this_ptr);
39         }
40
41         public OutPoint(byte[] txid_arg, short index_arg) {
42                 super(bindings.OutPoint_new(txid_arg, index_arg));
43         }
44
45         public byte[] to_channel_id() {
46                 byte[] ret = bindings.OutPoint_to_channel_id(this.ptr);
47                 return ret;
48         }
49
50         // Skipped OutPoint_write
51         public OutPoint(byte[] ser) {
52                 super(bindings.OutPoint_read(ser));
53         }
54
55 }