Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / GossipTimestampFilter.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 gossip_timestamp_filter message is used by a node to request
11  * gossip relay for messages in the requested time range when the
12  * gossip_queries feature has been negotiated.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class GossipTimestampFilter extends CommonBase {
16         GossipTimestampFilter(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); }
21         }
22
23         /**
24          * The genesis hash of the blockchain for channel and node information
25          */
26         public byte[] get_chain_hash() {
27                 byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr);
28                 return ret;
29         }
30
31         /**
32          * The genesis hash of the blockchain for channel and node information
33          */
34         public void set_chain_hash(byte[] val) {
35                 bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val);
36         }
37
38         /**
39          * The starting unix timestamp
40          */
41         public int get_first_timestamp() {
42                 int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr);
43                 return ret;
44         }
45
46         /**
47          * The starting unix timestamp
48          */
49         public void set_first_timestamp(int val) {
50                 bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val);
51         }
52
53         /**
54          * The range of information in seconds
55          */
56         public int get_timestamp_range() {
57                 int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr);
58                 return ret;
59         }
60
61         /**
62          * The range of information in seconds
63          */
64         public void set_timestamp_range(int val) {
65                 bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val);
66         }
67
68         /**
69          * Constructs a new GossipTimestampFilter given each field
70          */
71         public static GossipTimestampFilter of(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) {
72                 long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg);
73                 GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
74                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
75                 return ret_hu_conv;
76         }
77
78         /**
79          * Creates a copy of the GossipTimestampFilter
80          */
81         public GossipTimestampFilter clone() {
82                 long ret = bindings.GossipTimestampFilter_clone(this.ptr);
83                 GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
84                 ret_hu_conv.ptrs_to.add(this);
85                 return ret_hu_conv;
86         }
87
88         /**
89          * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
90          */
91         public static Result_GossipTimestampFilterDecodeErrorZ read(byte[] ser) {
92                 long ret = bindings.GossipTimestampFilter_read(ser);
93                 Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
94                 return ret_hu_conv;
95         }
96
97         /**
98          * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
99          */
100         public byte[] write() {
101                 byte[] ret = bindings.GossipTimestampFilter_write(this.ptr);
102                 return ret;
103         }
104
105 }