sawtooth.sdk.protobuf.ClientBlockListResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sawtooth-sdk-protos Show documentation
Show all versions of sawtooth-sdk-protos Show documentation
"Java classes generated from Sawtooth proto definition files, to interact with the component, consensus, and other validator interfaces"
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: client_block.proto
package sawtooth.sdk.protobuf;
/**
*
* A response that lists a chain of blocks with the newest at the beginning,
* and the oldest (genesis) block at the end.
* Statuses:
* * OK - everything worked as expected
* * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
* * NOT_READY - the validator does not yet have a genesis block
* * NO_ROOT - the head block specified was not found
* * NO_RESOURCE - no blocks were found with the parameters specified
* * INVALID_PAGING - the paging controls were malformed or out of range
* * INVALID_SORT - the sorting controls were malformed or invalid
*
*
* Protobuf type {@code ClientBlockListResponse}
*/
public final class ClientBlockListResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:ClientBlockListResponse)
ClientBlockListResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use ClientBlockListResponse.newBuilder() to construct.
private ClientBlockListResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ClientBlockListResponse() {
status_ = 0;
blocks_ = java.util.Collections.emptyList();
headId_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ClientBlockListResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
status_ = rawValue;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
blocks_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
blocks_.add(
input.readMessage(sawtooth.sdk.protobuf.Block.parser(), extensionRegistry));
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
headId_ = s;
break;
}
case 34: {
sawtooth.sdk.protobuf.ClientPagingResponse.Builder subBuilder = null;
if (paging_ != null) {
subBuilder = paging_.toBuilder();
}
paging_ = input.readMessage(sawtooth.sdk.protobuf.ClientPagingResponse.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(paging_);
paging_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
blocks_ = java.util.Collections.unmodifiableList(blocks_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return sawtooth.sdk.protobuf.ClientBlock.internal_static_ClientBlockListResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return sawtooth.sdk.protobuf.ClientBlock.internal_static_ClientBlockListResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
sawtooth.sdk.protobuf.ClientBlockListResponse.class, sawtooth.sdk.protobuf.ClientBlockListResponse.Builder.class);
}
/**
* Protobuf enum {@code ClientBlockListResponse.Status}
*/
public enum Status
implements com.google.protobuf.ProtocolMessageEnum {
/**
* STATUS_UNSET = 0;
*/
STATUS_UNSET(0),
/**
* OK = 1;
*/
OK(1),
/**
* INTERNAL_ERROR = 2;
*/
INTERNAL_ERROR(2),
/**
* NOT_READY = 3;
*/
NOT_READY(3),
/**
* NO_ROOT = 4;
*/
NO_ROOT(4),
/**
* NO_RESOURCE = 5;
*/
NO_RESOURCE(5),
/**
* INVALID_PAGING = 6;
*/
INVALID_PAGING(6),
/**
* INVALID_SORT = 7;
*/
INVALID_SORT(7),
/**
* INVALID_ID = 8;
*/
INVALID_ID(8),
UNRECOGNIZED(-1),
;
/**
* STATUS_UNSET = 0;
*/
public static final int STATUS_UNSET_VALUE = 0;
/**
* OK = 1;
*/
public static final int OK_VALUE = 1;
/**
* INTERNAL_ERROR = 2;
*/
public static final int INTERNAL_ERROR_VALUE = 2;
/**
* NOT_READY = 3;
*/
public static final int NOT_READY_VALUE = 3;
/**
* NO_ROOT = 4;
*/
public static final int NO_ROOT_VALUE = 4;
/**
* NO_RESOURCE = 5;
*/
public static final int NO_RESOURCE_VALUE = 5;
/**
* INVALID_PAGING = 6;
*/
public static final int INVALID_PAGING_VALUE = 6;
/**
* INVALID_SORT = 7;
*/
public static final int INVALID_SORT_VALUE = 7;
/**
* INVALID_ID = 8;
*/
public static final int INVALID_ID_VALUE = 8;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Status valueOf(int value) {
return forNumber(value);
}
public static Status forNumber(int value) {
switch (value) {
case 0: return STATUS_UNSET;
case 1: return OK;
case 2: return INTERNAL_ERROR;
case 3: return NOT_READY;
case 4: return NO_ROOT;
case 5: return NO_RESOURCE;
case 6: return INVALID_PAGING;
case 7: return INVALID_SORT;
case 8: return INVALID_ID;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Status> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Status findValueByNumber(int number) {
return Status.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return sawtooth.sdk.protobuf.ClientBlockListResponse.getDescriptor().getEnumTypes().get(0);
}
private static final Status[] VALUES = values();
public static Status valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Status(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:ClientBlockListResponse.Status)
}
private int bitField0_;
public static final int STATUS_FIELD_NUMBER = 1;
private int status_;
/**
* .ClientBlockListResponse.Status status = 1;
*/
public int getStatusValue() {
return status_;
}
/**
* .ClientBlockListResponse.Status status = 1;
*/
public sawtooth.sdk.protobuf.ClientBlockListResponse.Status getStatus() {
@SuppressWarnings("deprecation")
sawtooth.sdk.protobuf.ClientBlockListResponse.Status result = sawtooth.sdk.protobuf.ClientBlockListResponse.Status.valueOf(status_);
return result == null ? sawtooth.sdk.protobuf.ClientBlockListResponse.Status.UNRECOGNIZED : result;
}
public static final int BLOCKS_FIELD_NUMBER = 2;
private java.util.List blocks_;
/**
* repeated .Block blocks = 2;
*/
public java.util.List getBlocksList() {
return blocks_;
}
/**
* repeated .Block blocks = 2;
*/
public java.util.List extends sawtooth.sdk.protobuf.BlockOrBuilder>
getBlocksOrBuilderList() {
return blocks_;
}
/**
* repeated .Block blocks = 2;
*/
public int getBlocksCount() {
return blocks_.size();
}
/**
* repeated .Block blocks = 2;
*/
public sawtooth.sdk.protobuf.Block getBlocks(int index) {
return blocks_.get(index);
}
/**
* repeated .Block blocks = 2;
*/
public sawtooth.sdk.protobuf.BlockOrBuilder getBlocksOrBuilder(
int index) {
return blocks_.get(index);
}
public static final int HEAD_ID_FIELD_NUMBER = 3;
private volatile java.lang.Object headId_;
/**
* string head_id = 3;
*/
public java.lang.String getHeadId() {
java.lang.Object ref = headId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
headId_ = s;
return s;
}
}
/**
* string head_id = 3;
*/
public com.google.protobuf.ByteString
getHeadIdBytes() {
java.lang.Object ref = headId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
headId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PAGING_FIELD_NUMBER = 4;
private sawtooth.sdk.protobuf.ClientPagingResponse paging_;
/**
* .ClientPagingResponse paging = 4;
*/
public boolean hasPaging() {
return paging_ != null;
}
/**
* .ClientPagingResponse paging = 4;
*/
public sawtooth.sdk.protobuf.ClientPagingResponse getPaging() {
return paging_ == null ? sawtooth.sdk.protobuf.ClientPagingResponse.getDefaultInstance() : paging_;
}
/**
* .ClientPagingResponse paging = 4;
*/
public sawtooth.sdk.protobuf.ClientPagingResponseOrBuilder getPagingOrBuilder() {
return getPaging();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (status_ != sawtooth.sdk.protobuf.ClientBlockListResponse.Status.STATUS_UNSET.getNumber()) {
output.writeEnum(1, status_);
}
for (int i = 0; i < blocks_.size(); i++) {
output.writeMessage(2, blocks_.get(i));
}
if (!getHeadIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, headId_);
}
if (paging_ != null) {
output.writeMessage(4, getPaging());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (status_ != sawtooth.sdk.protobuf.ClientBlockListResponse.Status.STATUS_UNSET.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, status_);
}
for (int i = 0; i < blocks_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, blocks_.get(i));
}
if (!getHeadIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, headId_);
}
if (paging_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getPaging());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof sawtooth.sdk.protobuf.ClientBlockListResponse)) {
return super.equals(obj);
}
sawtooth.sdk.protobuf.ClientBlockListResponse other = (sawtooth.sdk.protobuf.ClientBlockListResponse) obj;
boolean result = true;
result = result && status_ == other.status_;
result = result && getBlocksList()
.equals(other.getBlocksList());
result = result && getHeadId()
.equals(other.getHeadId());
result = result && (hasPaging() == other.hasPaging());
if (hasPaging()) {
result = result && getPaging()
.equals(other.getPaging());
}
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + status_;
if (getBlocksCount() > 0) {
hash = (37 * hash) + BLOCKS_FIELD_NUMBER;
hash = (53 * hash) + getBlocksList().hashCode();
}
hash = (37 * hash) + HEAD_ID_FIELD_NUMBER;
hash = (53 * hash) + getHeadId().hashCode();
if (hasPaging()) {
hash = (37 * hash) + PAGING_FIELD_NUMBER;
hash = (53 * hash) + getPaging().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(sawtooth.sdk.protobuf.ClientBlockListResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* A response that lists a chain of blocks with the newest at the beginning,
* and the oldest (genesis) block at the end.
* Statuses:
* * OK - everything worked as expected
* * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
* * NOT_READY - the validator does not yet have a genesis block
* * NO_ROOT - the head block specified was not found
* * NO_RESOURCE - no blocks were found with the parameters specified
* * INVALID_PAGING - the paging controls were malformed or out of range
* * INVALID_SORT - the sorting controls were malformed or invalid
*
*
* Protobuf type {@code ClientBlockListResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:ClientBlockListResponse)
sawtooth.sdk.protobuf.ClientBlockListResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return sawtooth.sdk.protobuf.ClientBlock.internal_static_ClientBlockListResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return sawtooth.sdk.protobuf.ClientBlock.internal_static_ClientBlockListResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
sawtooth.sdk.protobuf.ClientBlockListResponse.class, sawtooth.sdk.protobuf.ClientBlockListResponse.Builder.class);
}
// Construct using sawtooth.sdk.protobuf.ClientBlockListResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getBlocksFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
status_ = 0;
if (blocksBuilder_ == null) {
blocks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
blocksBuilder_.clear();
}
headId_ = "";
if (pagingBuilder_ == null) {
paging_ = null;
} else {
paging_ = null;
pagingBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return sawtooth.sdk.protobuf.ClientBlock.internal_static_ClientBlockListResponse_descriptor;
}
@java.lang.Override
public sawtooth.sdk.protobuf.ClientBlockListResponse getDefaultInstanceForType() {
return sawtooth.sdk.protobuf.ClientBlockListResponse.getDefaultInstance();
}
@java.lang.Override
public sawtooth.sdk.protobuf.ClientBlockListResponse build() {
sawtooth.sdk.protobuf.ClientBlockListResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public sawtooth.sdk.protobuf.ClientBlockListResponse buildPartial() {
sawtooth.sdk.protobuf.ClientBlockListResponse result = new sawtooth.sdk.protobuf.ClientBlockListResponse(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.status_ = status_;
if (blocksBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
blocks_ = java.util.Collections.unmodifiableList(blocks_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.blocks_ = blocks_;
} else {
result.blocks_ = blocksBuilder_.build();
}
result.headId_ = headId_;
if (pagingBuilder_ == null) {
result.paging_ = paging_;
} else {
result.paging_ = pagingBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return (Builder) super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof sawtooth.sdk.protobuf.ClientBlockListResponse) {
return mergeFrom((sawtooth.sdk.protobuf.ClientBlockListResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(sawtooth.sdk.protobuf.ClientBlockListResponse other) {
if (other == sawtooth.sdk.protobuf.ClientBlockListResponse.getDefaultInstance()) return this;
if (other.status_ != 0) {
setStatusValue(other.getStatusValue());
}
if (blocksBuilder_ == null) {
if (!other.blocks_.isEmpty()) {
if (blocks_.isEmpty()) {
blocks_ = other.blocks_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureBlocksIsMutable();
blocks_.addAll(other.blocks_);
}
onChanged();
}
} else {
if (!other.blocks_.isEmpty()) {
if (blocksBuilder_.isEmpty()) {
blocksBuilder_.dispose();
blocksBuilder_ = null;
blocks_ = other.blocks_;
bitField0_ = (bitField0_ & ~0x00000002);
blocksBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getBlocksFieldBuilder() : null;
} else {
blocksBuilder_.addAllMessages(other.blocks_);
}
}
}
if (!other.getHeadId().isEmpty()) {
headId_ = other.headId_;
onChanged();
}
if (other.hasPaging()) {
mergePaging(other.getPaging());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
sawtooth.sdk.protobuf.ClientBlockListResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (sawtooth.sdk.protobuf.ClientBlockListResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int status_ = 0;
/**
* .ClientBlockListResponse.Status status = 1;
*/
public int getStatusValue() {
return status_;
}
/**
* .ClientBlockListResponse.Status status = 1;
*/
public Builder setStatusValue(int value) {
status_ = value;
onChanged();
return this;
}
/**
* .ClientBlockListResponse.Status status = 1;
*/
public sawtooth.sdk.protobuf.ClientBlockListResponse.Status getStatus() {
@SuppressWarnings("deprecation")
sawtooth.sdk.protobuf.ClientBlockListResponse.Status result = sawtooth.sdk.protobuf.ClientBlockListResponse.Status.valueOf(status_);
return result == null ? sawtooth.sdk.protobuf.ClientBlockListResponse.Status.UNRECOGNIZED : result;
}
/**
* .ClientBlockListResponse.Status status = 1;
*/
public Builder setStatus(sawtooth.sdk.protobuf.ClientBlockListResponse.Status value) {
if (value == null) {
throw new NullPointerException();
}
status_ = value.getNumber();
onChanged();
return this;
}
/**
* .ClientBlockListResponse.Status status = 1;
*/
public Builder clearStatus() {
status_ = 0;
onChanged();
return this;
}
private java.util.List blocks_ =
java.util.Collections.emptyList();
private void ensureBlocksIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
blocks_ = new java.util.ArrayList(blocks_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
sawtooth.sdk.protobuf.Block, sawtooth.sdk.protobuf.Block.Builder, sawtooth.sdk.protobuf.BlockOrBuilder> blocksBuilder_;
/**
* repeated .Block blocks = 2;
*/
public java.util.List getBlocksList() {
if (blocksBuilder_ == null) {
return java.util.Collections.unmodifiableList(blocks_);
} else {
return blocksBuilder_.getMessageList();
}
}
/**
* repeated .Block blocks = 2;
*/
public int getBlocksCount() {
if (blocksBuilder_ == null) {
return blocks_.size();
} else {
return blocksBuilder_.getCount();
}
}
/**
* repeated .Block blocks = 2;
*/
public sawtooth.sdk.protobuf.Block getBlocks(int index) {
if (blocksBuilder_ == null) {
return blocks_.get(index);
} else {
return blocksBuilder_.getMessage(index);
}
}
/**
* repeated .Block blocks = 2;
*/
public Builder setBlocks(
int index, sawtooth.sdk.protobuf.Block value) {
if (blocksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureBlocksIsMutable();
blocks_.set(index, value);
onChanged();
} else {
blocksBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder setBlocks(
int index, sawtooth.sdk.protobuf.Block.Builder builderForValue) {
if (blocksBuilder_ == null) {
ensureBlocksIsMutable();
blocks_.set(index, builderForValue.build());
onChanged();
} else {
blocksBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder addBlocks(sawtooth.sdk.protobuf.Block value) {
if (blocksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureBlocksIsMutable();
blocks_.add(value);
onChanged();
} else {
blocksBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder addBlocks(
int index, sawtooth.sdk.protobuf.Block value) {
if (blocksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureBlocksIsMutable();
blocks_.add(index, value);
onChanged();
} else {
blocksBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder addBlocks(
sawtooth.sdk.protobuf.Block.Builder builderForValue) {
if (blocksBuilder_ == null) {
ensureBlocksIsMutable();
blocks_.add(builderForValue.build());
onChanged();
} else {
blocksBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder addBlocks(
int index, sawtooth.sdk.protobuf.Block.Builder builderForValue) {
if (blocksBuilder_ == null) {
ensureBlocksIsMutable();
blocks_.add(index, builderForValue.build());
onChanged();
} else {
blocksBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder addAllBlocks(
java.lang.Iterable extends sawtooth.sdk.protobuf.Block> values) {
if (blocksBuilder_ == null) {
ensureBlocksIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, blocks_);
onChanged();
} else {
blocksBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder clearBlocks() {
if (blocksBuilder_ == null) {
blocks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
blocksBuilder_.clear();
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public Builder removeBlocks(int index) {
if (blocksBuilder_ == null) {
ensureBlocksIsMutable();
blocks_.remove(index);
onChanged();
} else {
blocksBuilder_.remove(index);
}
return this;
}
/**
* repeated .Block blocks = 2;
*/
public sawtooth.sdk.protobuf.Block.Builder getBlocksBuilder(
int index) {
return getBlocksFieldBuilder().getBuilder(index);
}
/**
* repeated .Block blocks = 2;
*/
public sawtooth.sdk.protobuf.BlockOrBuilder getBlocksOrBuilder(
int index) {
if (blocksBuilder_ == null) {
return blocks_.get(index); } else {
return blocksBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .Block blocks = 2;
*/
public java.util.List extends sawtooth.sdk.protobuf.BlockOrBuilder>
getBlocksOrBuilderList() {
if (blocksBuilder_ != null) {
return blocksBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(blocks_);
}
}
/**
* repeated .Block blocks = 2;
*/
public sawtooth.sdk.protobuf.Block.Builder addBlocksBuilder() {
return getBlocksFieldBuilder().addBuilder(
sawtooth.sdk.protobuf.Block.getDefaultInstance());
}
/**
* repeated .Block blocks = 2;
*/
public sawtooth.sdk.protobuf.Block.Builder addBlocksBuilder(
int index) {
return getBlocksFieldBuilder().addBuilder(
index, sawtooth.sdk.protobuf.Block.getDefaultInstance());
}
/**
* repeated .Block blocks = 2;
*/
public java.util.List
getBlocksBuilderList() {
return getBlocksFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
sawtooth.sdk.protobuf.Block, sawtooth.sdk.protobuf.Block.Builder, sawtooth.sdk.protobuf.BlockOrBuilder>
getBlocksFieldBuilder() {
if (blocksBuilder_ == null) {
blocksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
sawtooth.sdk.protobuf.Block, sawtooth.sdk.protobuf.Block.Builder, sawtooth.sdk.protobuf.BlockOrBuilder>(
blocks_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
blocks_ = null;
}
return blocksBuilder_;
}
private java.lang.Object headId_ = "";
/**
* string head_id = 3;
*/
public java.lang.String getHeadId() {
java.lang.Object ref = headId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
headId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* string head_id = 3;
*/
public com.google.protobuf.ByteString
getHeadIdBytes() {
java.lang.Object ref = headId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
headId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* string head_id = 3;
*/
public Builder setHeadId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
headId_ = value;
onChanged();
return this;
}
/**
* string head_id = 3;
*/
public Builder clearHeadId() {
headId_ = getDefaultInstance().getHeadId();
onChanged();
return this;
}
/**
* string head_id = 3;
*/
public Builder setHeadIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
headId_ = value;
onChanged();
return this;
}
private sawtooth.sdk.protobuf.ClientPagingResponse paging_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
sawtooth.sdk.protobuf.ClientPagingResponse, sawtooth.sdk.protobuf.ClientPagingResponse.Builder, sawtooth.sdk.protobuf.ClientPagingResponseOrBuilder> pagingBuilder_;
/**
* .ClientPagingResponse paging = 4;
*/
public boolean hasPaging() {
return pagingBuilder_ != null || paging_ != null;
}
/**
* .ClientPagingResponse paging = 4;
*/
public sawtooth.sdk.protobuf.ClientPagingResponse getPaging() {
if (pagingBuilder_ == null) {
return paging_ == null ? sawtooth.sdk.protobuf.ClientPagingResponse.getDefaultInstance() : paging_;
} else {
return pagingBuilder_.getMessage();
}
}
/**
* .ClientPagingResponse paging = 4;
*/
public Builder setPaging(sawtooth.sdk.protobuf.ClientPagingResponse value) {
if (pagingBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
paging_ = value;
onChanged();
} else {
pagingBuilder_.setMessage(value);
}
return this;
}
/**
* .ClientPagingResponse paging = 4;
*/
public Builder setPaging(
sawtooth.sdk.protobuf.ClientPagingResponse.Builder builderForValue) {
if (pagingBuilder_ == null) {
paging_ = builderForValue.build();
onChanged();
} else {
pagingBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* .ClientPagingResponse paging = 4;
*/
public Builder mergePaging(sawtooth.sdk.protobuf.ClientPagingResponse value) {
if (pagingBuilder_ == null) {
if (paging_ != null) {
paging_ =
sawtooth.sdk.protobuf.ClientPagingResponse.newBuilder(paging_).mergeFrom(value).buildPartial();
} else {
paging_ = value;
}
onChanged();
} else {
pagingBuilder_.mergeFrom(value);
}
return this;
}
/**
* .ClientPagingResponse paging = 4;
*/
public Builder clearPaging() {
if (pagingBuilder_ == null) {
paging_ = null;
onChanged();
} else {
paging_ = null;
pagingBuilder_ = null;
}
return this;
}
/**
* .ClientPagingResponse paging = 4;
*/
public sawtooth.sdk.protobuf.ClientPagingResponse.Builder getPagingBuilder() {
onChanged();
return getPagingFieldBuilder().getBuilder();
}
/**
* .ClientPagingResponse paging = 4;
*/
public sawtooth.sdk.protobuf.ClientPagingResponseOrBuilder getPagingOrBuilder() {
if (pagingBuilder_ != null) {
return pagingBuilder_.getMessageOrBuilder();
} else {
return paging_ == null ?
sawtooth.sdk.protobuf.ClientPagingResponse.getDefaultInstance() : paging_;
}
}
/**
* .ClientPagingResponse paging = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
sawtooth.sdk.protobuf.ClientPagingResponse, sawtooth.sdk.protobuf.ClientPagingResponse.Builder, sawtooth.sdk.protobuf.ClientPagingResponseOrBuilder>
getPagingFieldBuilder() {
if (pagingBuilder_ == null) {
pagingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
sawtooth.sdk.protobuf.ClientPagingResponse, sawtooth.sdk.protobuf.ClientPagingResponse.Builder, sawtooth.sdk.protobuf.ClientPagingResponseOrBuilder>(
getPaging(),
getParentForChildren(),
isClean());
paging_ = null;
}
return pagingBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:ClientBlockListResponse)
}
// @@protoc_insertion_point(class_scope:ClientBlockListResponse)
private static final sawtooth.sdk.protobuf.ClientBlockListResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new sawtooth.sdk.protobuf.ClientBlockListResponse();
}
public static sawtooth.sdk.protobuf.ClientBlockListResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ClientBlockListResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ClientBlockListResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public sawtooth.sdk.protobuf.ClientBlockListResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}