Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Pong.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 pong message to be sent or received from a peer
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class Pong extends CommonBase {
14         Pong(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.Pong_free(ptr); }
19         }
20
21         /**
22          * The pong packet size.
23          * This field is not sent on the wire. byteslen zeros are sent.
24          */
25         public short get_byteslen() {
26                 short ret = bindings.Pong_get_byteslen(this.ptr);
27                 return ret;
28         }
29
30         /**
31          * The pong packet size.
32          * This field is not sent on the wire. byteslen zeros are sent.
33          */
34         public void set_byteslen(short val) {
35                 bindings.Pong_set_byteslen(this.ptr, val);
36         }
37
38         /**
39          * Constructs a new Pong given each field
40          */
41         public static Pong of(short byteslen_arg) {
42                 long ret = bindings.Pong_new(byteslen_arg);
43                 Pong ret_hu_conv = new Pong(null, ret);
44                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
45                 return ret_hu_conv;
46         }
47
48         /**
49          * Creates a copy of the Pong
50          */
51         public Pong clone() {
52                 long ret = bindings.Pong_clone(this.ptr);
53                 Pong ret_hu_conv = new Pong(null, ret);
54                 ret_hu_conv.ptrs_to.add(this);
55                 return ret_hu_conv;
56         }
57
58         /**
59          * Serialize the Pong object into a byte array which can be read by Pong_read
60          */
61         public byte[] write() {
62                 byte[] ret = bindings.Pong_write(this.ptr);
63                 return ret;
64         }
65
66         /**
67          * Read a Pong from a byte array, created by Pong_write
68          */
69         public static Result_PongDecodeErrorZ read(byte[] ser) {
70                 long ret = bindings.Pong_read(ser);
71                 Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
72                 return ret_hu_conv;
73         }
74
75 }