X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FReplyChannelRange.java;h=4f6db16001a3436e2e9b30c1d41c76b7ba679938;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=d49f6a47c1a3db28f2d952e3adf3f68dcbd6ea4f;hpb=a9b82019e7ffa7d32d44943133bb64e1197bd2f1;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index d49f6a47..4f6db160 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.java @@ -4,7 +4,18 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; - +import javax.annotation.Nullable; + + +/** + * A reply_channel_range message is a reply to a query_channel_range + * message. Multiple reply_channel_range messages can be sent in reply + * to a single query_channel_range message. The query recipient makes a + * best effort to respond based on their local network view which may + * not be a perfect view of the network. The short_channel_ids in the + * reply are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ReplyChannelRange extends CommonBase { ReplyChannelRange(Object _dummy, long ptr) { super(ptr); } @@ -14,64 +25,108 @@ public class ReplyChannelRange extends CommonBase { if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); } } - public ReplyChannelRange clone() { - long ret = bindings.ReplyChannelRange_clone(this.ptr); - ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); - return ret_hu_conv; - } - + /** + * The genesis hash of the blockchain being queried + */ public byte[] get_chain_hash() { byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain being queried + */ public void set_chain_hash(byte[] val) { bindings.ReplyChannelRange_set_chain_hash(this.ptr, val); } + /** + * The height of the first block in the range of the reply + */ public int get_first_blocknum() { int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr); return ret; } + /** + * The height of the first block in the range of the reply + */ public void set_first_blocknum(int val) { bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val); } + /** + * The number of blocks included in the range of the reply + */ public int get_number_of_blocks() { int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr); return ret; } + /** + * The number of blocks included in the range of the reply + */ public void set_number_of_blocks(int val) { bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val); } - public boolean get_full_information() { - boolean ret = bindings.ReplyChannelRange_get_full_information(this.ptr); + /** + * True when this is the final reply for a query + */ + public boolean get_sync_complete() { + boolean ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr); return ret; } - public void set_full_information(boolean val) { - bindings.ReplyChannelRange_set_full_information(this.ptr, val); + /** + * True when this is the final reply for a query + */ + public void set_sync_complete(boolean val) { + bindings.ReplyChannelRange_set_sync_complete(this.ptr, val); } + /** + * The short_channel_ids in the channel range + */ public void set_short_channel_ids(long[] val) { bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val); } - public static ReplyChannelRange constructor_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean full_information_arg, long[] short_channel_ids_arg) { - long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg); - ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); + /** + * Constructs a new ReplyChannelRange given each field + */ + public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) { + long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); + if (ret >= 0 && ret <= 4096) { return null; } + ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); } + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Creates a copy of the ReplyChannelRange + */ + public ReplyChannelRange clone() { + long ret = bindings.ReplyChannelRange_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); } + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - public static Result_ReplyChannelRangeDecodeErrorZ constructor_read(byte[] ser) { + /** + * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write + */ + public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) { long ret = bindings.ReplyChannelRange_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read + */ public byte[] write() { byte[] ret = bindings.ReplyChannelRange_write(this.ptr); return ret;