Update to support None
[ldk-java] / src / main / java / org / ldk / structs / HTLCOutputInCommitment.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class HTLCOutputInCommitment extends CommonBase {
7         HTLCOutputInCommitment(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 bindings.HTLCOutputInCommitment_free(ptr); super.finalize();
11         }
12
13         public HTLCOutputInCommitment(HTLCOutputInCommitment orig) {
14                 super(bindings.HTLCOutputInCommitment_clone(orig == null ? 0 : orig.ptr & ~1));
15                 this.ptrs_to.add(orig);
16         }
17
18         public boolean get_offered(HTLCOutputInCommitment this_ptr) {
19                 boolean ret = bindings.HTLCOutputInCommitment_get_offered(this_ptr == null ? 0 : this_ptr.ptr & ~1);
20                 this.ptrs_to.add(this_ptr);
21                 return ret;
22         }
23
24         public void set_offered(HTLCOutputInCommitment this_ptr, boolean val) {
25                 bindings.HTLCOutputInCommitment_set_offered(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
26                 this.ptrs_to.add(this_ptr);
27         }
28
29         public long get_amount_msat(HTLCOutputInCommitment this_ptr) {
30                 long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
31                 this.ptrs_to.add(this_ptr);
32                 return ret;
33         }
34
35         public void set_amount_msat(HTLCOutputInCommitment this_ptr, long val) {
36                 bindings.HTLCOutputInCommitment_set_amount_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
37                 this.ptrs_to.add(this_ptr);
38         }
39
40         public int get_cltv_expiry(HTLCOutputInCommitment this_ptr) {
41                 int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this_ptr == null ? 0 : this_ptr.ptr & ~1);
42                 this.ptrs_to.add(this_ptr);
43                 return ret;
44         }
45
46         public void set_cltv_expiry(HTLCOutputInCommitment this_ptr, int val) {
47                 bindings.HTLCOutputInCommitment_set_cltv_expiry(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
48                 this.ptrs_to.add(this_ptr);
49         }
50
51         public byte[] get_payment_hash(HTLCOutputInCommitment this_ptr) {
52                 byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1);
53                 this.ptrs_to.add(this_ptr);
54                 return ret;
55         }
56
57         public void set_payment_hash(HTLCOutputInCommitment this_ptr, byte[] val) {
58                 bindings.HTLCOutputInCommitment_set_payment_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
59                 this.ptrs_to.add(this_ptr);
60         }
61
62         // Skipped HTLCOutputInCommitment_write
63         public HTLCOutputInCommitment(byte[] ser) {
64                 super(bindings.HTLCOutputInCommitment_read(ser));
65         }
66
67 }