X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FGossipTimestampFilter.java;h=55458e73140263db4c879fe9852f42bb4a3977f0;hb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;hp=9bac7c1f408ce802f1b7007d7281da01930025ac;hpb=3d559f3266fde7c6a21248c10d9a7145125b5e69;p=ldk-java diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index 9bac7c1f..55458e73 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -2,56 +2,68 @@ package org.ldk.structs; import org.ldk.impl.bindings; import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class GossipTimestampFilter extends CommonBase { GossipTimestampFilter(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { - bindings.GossipTimestampFilter_free(ptr); super.finalize(); + super.finalize(); + if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); } } - public GossipTimestampFilter(GossipTimestampFilter orig) { - super(bindings.GossipTimestampFilter_clone(orig.ptr & ~1)); - this.ptrs_to.add(orig); + public GossipTimestampFilter clone() { + long ret = bindings.GossipTimestampFilter_clone(this.ptr); + GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; } - public byte[] get_chain_hash(GossipTimestampFilter this_ptr) { - byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_chain_hash() { + byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(GossipTimestampFilter this_ptr, byte[] val) { - bindings.GossipTimestampFilter_set_chain_hash(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_chain_hash(byte[] val) { + bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val); } - public int get_first_timestamp(GossipTimestampFilter this_ptr) { - int ret = bindings.GossipTimestampFilter_get_first_timestamp(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public int get_first_timestamp() { + int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr); return ret; } - public void set_first_timestamp(GossipTimestampFilter this_ptr, int val) { - bindings.GossipTimestampFilter_set_first_timestamp(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_first_timestamp(int val) { + bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val); } - public int get_timestamp_range(GossipTimestampFilter this_ptr) { - int ret = bindings.GossipTimestampFilter_get_timestamp_range(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public int get_timestamp_range() { + int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr); return ret; } - public void set_timestamp_range(GossipTimestampFilter this_ptr, int val) { - bindings.GossipTimestampFilter_set_timestamp_range(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_timestamp_range(int val) { + bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val); } - public GossipTimestampFilter(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) { - super(bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg)); + public static GossipTimestampFilter constructor_new(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); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + 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; + } + + public byte[] write() { + byte[] ret = bindings.GossipTimestampFilter_write(this.ptr); + return ret; } - // Skipped GossipTimestampFilter_read - // Skipped GossipTimestampFilter_write }