Use AutoCloseable for structs named Locked*
[ldk-java] / src / main / java / org / ldk / structs / CommitmentUpdate.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class CommitmentUpdate extends CommonBase {
7         CommitmentUpdate(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 super.finalize();
11                 bindings.CommitmentUpdate_free(ptr);
12         }
13
14         public CommitmentUpdate(CommitmentUpdate orig) {
15                 super(bindings.CommitmentUpdate_clone(orig == null ? 0 : orig.ptr & ~1));
16                 this.ptrs_to.add(orig);
17         }
18
19         // Skipped CommitmentUpdate_set_update_add_htlcs
20         // Skipped CommitmentUpdate_set_update_fulfill_htlcs
21         // Skipped CommitmentUpdate_set_update_fail_htlcs
22         // Skipped CommitmentUpdate_set_update_fail_malformed_htlcs
23         public UpdateFee get_update_fee(CommitmentUpdate this_ptr) {
24                 UpdateFee ret = new UpdateFee(null, bindings.CommitmentUpdate_get_update_fee(this_ptr == null ? 0 : this_ptr.ptr & ~1));
25                 this.ptrs_to.add(this_ptr);
26                 return ret;
27         }
28
29         public void set_update_fee(CommitmentUpdate this_ptr, UpdateFee val) {
30                 bindings.CommitmentUpdate_set_update_fee(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
31                 this.ptrs_to.add(this_ptr);
32                 this.ptrs_to.add(val);
33         }
34
35         public CommitmentSigned get_commitment_signed(CommitmentUpdate this_ptr) {
36                 CommitmentSigned ret = new CommitmentSigned(null, bindings.CommitmentUpdate_get_commitment_signed(this_ptr == null ? 0 : this_ptr.ptr & ~1));
37                 this.ptrs_to.add(this_ptr);
38                 return ret;
39         }
40
41         public void set_commitment_signed(CommitmentUpdate this_ptr, CommitmentSigned val) {
42                 bindings.CommitmentUpdate_set_commitment_signed(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
43                 this.ptrs_to.add(this_ptr);
44                 this.ptrs_to.add(val);
45         }
46
47         // Skipped CommitmentUpdate_new
48 }