X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FGossipTimestampFilter.java;h=2693985bcfab6913ccad310676a52249624f77ff;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=f63dbdd3fa260e1f4f2971f0f60bac49d1908295;hpb=17113550a5fefab21f39f27fbfe02646b8db53ae;p=ldk-java diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index f63dbdd3..2693985b 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; /** @@ -68,9 +69,10 @@ public class GossipTimestampFilter extends CommonBase { /** * Constructs a new GossipTimestampFilter given each field */ - public static GossipTimestampFilter constructor_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) { + public static GossipTimestampFilter of(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) { long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); - GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new GossipTimestampFilter(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -80,20 +82,12 @@ public class GossipTimestampFilter extends CommonBase { */ public GossipTimestampFilter clone() { long ret = bindings.GossipTimestampFilter_clone(this.ptr); - GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new GossipTimestampFilter(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - /** - * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write - */ - public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(byte[] ser) { - long ret = bindings.GossipTimestampFilter_read(ser); - Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read */ @@ -102,4 +96,14 @@ public class GossipTimestampFilter extends CommonBase { return ret; } + /** + * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write + */ + public static Result_GossipTimestampFilterDecodeErrorZ read(byte[] ser) { + long ret = bindings.GossipTimestampFilter_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }