Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / RevokeAndACK.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 revoke_and_ack message to be sent or received from a peer
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class RevokeAndACK extends CommonBase {
14         RevokeAndACK(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.RevokeAndACK_free(ptr); }
19         }
20
21         /**
22          * The channel ID
23          */
24         public byte[] get_channel_id() {
25                 byte[] ret = bindings.RevokeAndACK_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.RevokeAndACK_set_channel_id(this.ptr, val);
34         }
35
36         /**
37          * The secret corresponding to the per-commitment point
38          */
39         public byte[] get_per_commitment_secret() {
40                 byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this.ptr);
41                 return ret;
42         }
43
44         /**
45          * The secret corresponding to the per-commitment point
46          */
47         public void set_per_commitment_secret(byte[] val) {
48                 bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, val);
49         }
50
51         /**
52          * The next sender-broadcast commitment transaction's per-commitment point
53          */
54         public byte[] get_next_per_commitment_point() {
55                 byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this.ptr);
56                 return ret;
57         }
58
59         /**
60          * The next sender-broadcast commitment transaction's per-commitment point
61          */
62         public void set_next_per_commitment_point(byte[] val) {
63                 bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, val);
64         }
65
66         /**
67          * Constructs a new RevokeAndACK given each field
68          */
69         public static RevokeAndACK of(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) {
70                 long ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg);
71                 if (ret < 1024) { return null; }
72                 RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
73                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
74                 return ret_hu_conv;
75         }
76
77         /**
78          * Creates a copy of the RevokeAndACK
79          */
80         public RevokeAndACK clone() {
81                 long ret = bindings.RevokeAndACK_clone(this.ptr);
82                 if (ret < 1024) { return null; }
83                 RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
84                 ret_hu_conv.ptrs_to.add(this);
85                 return ret_hu_conv;
86         }
87
88         /**
89          * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
90          */
91         public byte[] write() {
92                 byte[] ret = bindings.RevokeAndACK_write(this.ptr);
93                 return ret;
94         }
95
96         /**
97          * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
98          */
99         public static Result_RevokeAndACKDecodeErrorZ read(byte[] ser) {
100                 long ret = bindings.RevokeAndACK_read(ser);
101                 if (ret < 1024) { return null; }
102                 Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
103                 return ret_hu_conv;
104         }
105
106 }