Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / CommitmentSigned.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8
9 /**
10  * A commitment_signed message to be sent or received from a peer
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class CommitmentSigned extends CommonBase {
14         CommitmentSigned(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.CommitmentSigned_free(ptr); }
19         }
20
21         /**
22          * The channel ID
23          */
24         public byte[] get_channel_id() {
25                 byte[] ret = bindings.CommitmentSigned_get_channel_id(this.ptr);
26                 return ret;
27         }
28
29         /**
30          * The channel ID
31          */
32         public void set_channel_id(byte[] val) {
33                 bindings.CommitmentSigned_set_channel_id(this.ptr, val);
34         }
35
36         /**
37          * A signature on the commitment transaction
38          */
39         public byte[] get_signature() {
40                 byte[] ret = bindings.CommitmentSigned_get_signature(this.ptr);
41                 return ret;
42         }
43
44         /**
45          * A signature on the commitment transaction
46          */
47         public void set_signature(byte[] val) {
48                 bindings.CommitmentSigned_set_signature(this.ptr, val);
49         }
50
51         /**
52          * Signatures on the HTLC transactions
53          */
54         public void set_htlc_signatures(byte[][] val) {
55                 bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val);
56         }
57
58         /**
59          * Constructs a new CommitmentSigned given each field
60          */
61         public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
62                 long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg);
63                 CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
64                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
65                 return ret_hu_conv;
66         }
67
68         /**
69          * Creates a copy of the CommitmentSigned
70          */
71         public CommitmentSigned clone() {
72                 long ret = bindings.CommitmentSigned_clone(this.ptr);
73                 CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
74                 ret_hu_conv.ptrs_to.add(this);
75                 return ret_hu_conv;
76         }
77
78         /**
79          * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
80          */
81         public byte[] write() {
82                 byte[] ret = bindings.CommitmentSigned_write(this.ptr);
83                 return ret;
84         }
85
86         /**
87          * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
88          */
89         public static Result_CommitmentSignedDecodeErrorZ read(byte[] ser) {
90                 long ret = bindings.CommitmentSigned_read(ser);
91                 Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
92                 return ret_hu_conv;
93         }
94
95 }