Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / FundingLocked.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 funding_locked message to be sent or received from a peer
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class FundingLocked extends CommonBase {
14         FundingLocked(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.FundingLocked_free(ptr); }
19         }
20
21         /**
22          * The channel ID
23          */
24         public byte[] get_channel_id() {
25                 byte[] ret = bindings.FundingLocked_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.FundingLocked_set_channel_id(this.ptr, val);
34         }
35
36         /**
37          * The per-commitment point of the second commitment transaction
38          */
39         public byte[] get_next_per_commitment_point() {
40                 byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this.ptr);
41                 return ret;
42         }
43
44         /**
45          * The per-commitment point of the second commitment transaction
46          */
47         public void set_next_per_commitment_point(byte[] val) {
48                 bindings.FundingLocked_set_next_per_commitment_point(this.ptr, val);
49         }
50
51         /**
52          * Constructs a new FundingLocked given each field
53          */
54         public static FundingLocked of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg) {
55                 long ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg);
56                 FundingLocked ret_hu_conv = new FundingLocked(null, ret);
57                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
58                 return ret_hu_conv;
59         }
60
61         /**
62          * Creates a copy of the FundingLocked
63          */
64         public FundingLocked clone() {
65                 long ret = bindings.FundingLocked_clone(this.ptr);
66                 FundingLocked ret_hu_conv = new FundingLocked(null, ret);
67                 ret_hu_conv.ptrs_to.add(this);
68                 return ret_hu_conv;
69         }
70
71         /**
72          * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
73          */
74         public byte[] write() {
75                 byte[] ret = bindings.FundingLocked_write(this.ptr);
76                 return ret;
77         }
78
79         /**
80          * Read a FundingLocked from a byte array, created by FundingLocked_write
81          */
82         public static Result_FundingLockedDecodeErrorZ read(byte[] ser) {
83                 long ret = bindings.FundingLocked_read(ser);
84                 Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
85                 return ret_hu_conv;
86         }
87
88 }