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