com.ibm.etcd.api.WatchResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of etcd-java Show documentation
Show all versions of etcd-java Show documentation
etcd3 java client and utilities
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: rpc.proto
package com.ibm.etcd.api;
/**
* Protobuf type {@code etcdserverpb.WatchResponse}
*/
public final class WatchResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:etcdserverpb.WatchResponse)
WatchResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use WatchResponse.newBuilder() to construct.
private WatchResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private WatchResponse() {
cancelReason_ = "";
events_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new WatchResponse();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private WatchResponse(
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 10: {
com.ibm.etcd.api.ResponseHeader.Builder subBuilder = null;
if (header_ != null) {
subBuilder = header_.toBuilder();
}
header_ = input.readMessage(com.ibm.etcd.api.ResponseHeader.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(header_);
header_ = subBuilder.buildPartial();
}
break;
}
case 16: {
watchId_ = input.readInt64();
break;
}
case 24: {
created_ = input.readBool();
break;
}
case 32: {
canceled_ = input.readBool();
break;
}
case 40: {
compactRevision_ = input.readInt64();
break;
}
case 50: {
java.lang.String s = input.readStringRequireUtf8();
cancelReason_ = s;
break;
}
case 56: {
fragment_ = input.readBool();
break;
}
case 90: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
events_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
events_.add(
input.readMessage(com.ibm.etcd.api.Event.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
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_ & 0x00000001) != 0)) {
events_ = java.util.Collections.unmodifiableList(events_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_WatchResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_WatchResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.WatchResponse.class, com.ibm.etcd.api.WatchResponse.Builder.class);
}
public static final int HEADER_FIELD_NUMBER = 1;
private com.ibm.etcd.api.ResponseHeader header_;
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return Whether the header field is set.
*/
@java.lang.Override
public boolean hasHeader() {
return header_ != null;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return The header.
*/
@java.lang.Override
public com.ibm.etcd.api.ResponseHeader getHeader() {
return header_ == null ? com.ibm.etcd.api.ResponseHeader.getDefaultInstance() : header_;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
@java.lang.Override
public com.ibm.etcd.api.ResponseHeaderOrBuilder getHeaderOrBuilder() {
return getHeader();
}
public static final int WATCH_ID_FIELD_NUMBER = 2;
private long watchId_;
/**
*
* watch_id is the ID of the watcher that corresponds to the response.
*
*
* int64 watch_id = 2;
* @return The watchId.
*/
@java.lang.Override
public long getWatchId() {
return watchId_;
}
public static final int CREATED_FIELD_NUMBER = 3;
private boolean created_;
/**
*
* created is set to true if the response is for a create watch request.
* The client should record the watch_id and expect to receive events for
* the created watcher from the same stream.
* All events sent to the created watcher will attach with the same watch_id.
*
*
* bool created = 3;
* @return The created.
*/
@java.lang.Override
public boolean getCreated() {
return created_;
}
public static final int CANCELED_FIELD_NUMBER = 4;
private boolean canceled_;
/**
*
* canceled is set to true if the response is for a cancel watch request.
* No further events will be sent to the canceled watcher.
*
*
* bool canceled = 4;
* @return The canceled.
*/
@java.lang.Override
public boolean getCanceled() {
return canceled_;
}
public static final int COMPACT_REVISION_FIELD_NUMBER = 5;
private long compactRevision_;
/**
*
* compact_revision is set to the minimum index if a watcher tries to watch
* at a compacted index.
* This happens when creating a watcher at a compacted revision or the watcher cannot
* catch up with the progress of the key-value store.
* The client should treat the watcher as canceled and should not try to create any
* watcher with the same start_revision again.
*
*
* int64 compact_revision = 5;
* @return The compactRevision.
*/
@java.lang.Override
public long getCompactRevision() {
return compactRevision_;
}
public static final int CANCEL_REASON_FIELD_NUMBER = 6;
private volatile java.lang.Object cancelReason_;
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
* @return The cancelReason.
*/
@java.lang.Override
public java.lang.String getCancelReason() {
java.lang.Object ref = cancelReason_;
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();
cancelReason_ = s;
return s;
}
}
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
* @return The bytes for cancelReason.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getCancelReasonBytes() {
java.lang.Object ref = cancelReason_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
cancelReason_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FRAGMENT_FIELD_NUMBER = 7;
private boolean fragment_;
/**
*
* framgment is true if large watch response was split over multiple responses.
*
*
* bool fragment = 7;
* @return The fragment.
*/
@java.lang.Override
public boolean getFragment() {
return fragment_;
}
public static final int EVENTS_FIELD_NUMBER = 11;
private java.util.List events_;
/**
* repeated .mvccpb.Event events = 11;
*/
@java.lang.Override
public java.util.List getEventsList() {
return events_;
}
/**
* repeated .mvccpb.Event events = 11;
*/
@java.lang.Override
public java.util.List extends com.ibm.etcd.api.EventOrBuilder>
getEventsOrBuilderList() {
return events_;
}
/**
* repeated .mvccpb.Event events = 11;
*/
@java.lang.Override
public int getEventsCount() {
return events_.size();
}
/**
* repeated .mvccpb.Event events = 11;
*/
@java.lang.Override
public com.ibm.etcd.api.Event getEvents(int index) {
return events_.get(index);
}
/**
* repeated .mvccpb.Event events = 11;
*/
@java.lang.Override
public com.ibm.etcd.api.EventOrBuilder getEventsOrBuilder(
int index) {
return events_.get(index);
}
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 (header_ != null) {
output.writeMessage(1, getHeader());
}
if (watchId_ != 0L) {
output.writeInt64(2, watchId_);
}
if (created_ != false) {
output.writeBool(3, created_);
}
if (canceled_ != false) {
output.writeBool(4, canceled_);
}
if (compactRevision_ != 0L) {
output.writeInt64(5, compactRevision_);
}
if (!getCancelReasonBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, cancelReason_);
}
if (fragment_ != false) {
output.writeBool(7, fragment_);
}
for (int i = 0; i < events_.size(); i++) {
output.writeMessage(11, events_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (header_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getHeader());
}
if (watchId_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, watchId_);
}
if (created_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(3, created_);
}
if (canceled_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(4, canceled_);
}
if (compactRevision_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(5, compactRevision_);
}
if (!getCancelReasonBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, cancelReason_);
}
if (fragment_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(7, fragment_);
}
for (int i = 0; i < events_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(11, events_.get(i));
}
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 com.ibm.etcd.api.WatchResponse)) {
return super.equals(obj);
}
com.ibm.etcd.api.WatchResponse other = (com.ibm.etcd.api.WatchResponse) obj;
if (hasHeader() != other.hasHeader()) return false;
if (hasHeader()) {
if (!getHeader()
.equals(other.getHeader())) return false;
}
if (getWatchId()
!= other.getWatchId()) return false;
if (getCreated()
!= other.getCreated()) return false;
if (getCanceled()
!= other.getCanceled()) return false;
if (getCompactRevision()
!= other.getCompactRevision()) return false;
if (!getCancelReason()
.equals(other.getCancelReason())) return false;
if (getFragment()
!= other.getFragment()) return false;
if (!getEventsList()
.equals(other.getEventsList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasHeader()) {
hash = (37 * hash) + HEADER_FIELD_NUMBER;
hash = (53 * hash) + getHeader().hashCode();
}
hash = (37 * hash) + WATCH_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getWatchId());
hash = (37 * hash) + CREATED_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getCreated());
hash = (37 * hash) + CANCELED_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getCanceled());
hash = (37 * hash) + COMPACT_REVISION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getCompactRevision());
hash = (37 * hash) + CANCEL_REASON_FIELD_NUMBER;
hash = (53 * hash) + getCancelReason().hashCode();
hash = (37 * hash) + FRAGMENT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getFragment());
if (getEventsCount() > 0) {
hash = (37 * hash) + EVENTS_FIELD_NUMBER;
hash = (53 * hash) + getEventsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.ibm.etcd.api.WatchResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.WatchResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ibm.etcd.api.WatchResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.WatchResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ibm.etcd.api.WatchResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.WatchResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ibm.etcd.api.WatchResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.WatchResponse 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 com.ibm.etcd.api.WatchResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.WatchResponse 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 com.ibm.etcd.api.WatchResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.WatchResponse 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(com.ibm.etcd.api.WatchResponse 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;
}
/**
* Protobuf type {@code etcdserverpb.WatchResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:etcdserverpb.WatchResponse)
com.ibm.etcd.api.WatchResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_WatchResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_WatchResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.WatchResponse.class, com.ibm.etcd.api.WatchResponse.Builder.class);
}
// Construct using com.ibm.etcd.api.WatchResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getEventsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (headerBuilder_ == null) {
header_ = null;
} else {
header_ = null;
headerBuilder_ = null;
}
watchId_ = 0L;
created_ = false;
canceled_ = false;
compactRevision_ = 0L;
cancelReason_ = "";
fragment_ = false;
if (eventsBuilder_ == null) {
events_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
eventsBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_WatchResponse_descriptor;
}
@java.lang.Override
public com.ibm.etcd.api.WatchResponse getDefaultInstanceForType() {
return com.ibm.etcd.api.WatchResponse.getDefaultInstance();
}
@java.lang.Override
public com.ibm.etcd.api.WatchResponse build() {
com.ibm.etcd.api.WatchResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.ibm.etcd.api.WatchResponse buildPartial() {
com.ibm.etcd.api.WatchResponse result = new com.ibm.etcd.api.WatchResponse(this);
int from_bitField0_ = bitField0_;
if (headerBuilder_ == null) {
result.header_ = header_;
} else {
result.header_ = headerBuilder_.build();
}
result.watchId_ = watchId_;
result.created_ = created_;
result.canceled_ = canceled_;
result.compactRevision_ = compactRevision_;
result.cancelReason_ = cancelReason_;
result.fragment_ = fragment_;
if (eventsBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
events_ = java.util.Collections.unmodifiableList(events_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.events_ = events_;
} else {
result.events_ = eventsBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.ibm.etcd.api.WatchResponse) {
return mergeFrom((com.ibm.etcd.api.WatchResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.ibm.etcd.api.WatchResponse other) {
if (other == com.ibm.etcd.api.WatchResponse.getDefaultInstance()) return this;
if (other.hasHeader()) {
mergeHeader(other.getHeader());
}
if (other.getWatchId() != 0L) {
setWatchId(other.getWatchId());
}
if (other.getCreated() != false) {
setCreated(other.getCreated());
}
if (other.getCanceled() != false) {
setCanceled(other.getCanceled());
}
if (other.getCompactRevision() != 0L) {
setCompactRevision(other.getCompactRevision());
}
if (!other.getCancelReason().isEmpty()) {
cancelReason_ = other.cancelReason_;
onChanged();
}
if (other.getFragment() != false) {
setFragment(other.getFragment());
}
if (eventsBuilder_ == null) {
if (!other.events_.isEmpty()) {
if (events_.isEmpty()) {
events_ = other.events_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureEventsIsMutable();
events_.addAll(other.events_);
}
onChanged();
}
} else {
if (!other.events_.isEmpty()) {
if (eventsBuilder_.isEmpty()) {
eventsBuilder_.dispose();
eventsBuilder_ = null;
events_ = other.events_;
bitField0_ = (bitField0_ & ~0x00000001);
eventsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getEventsFieldBuilder() : null;
} else {
eventsBuilder_.addAllMessages(other.events_);
}
}
}
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 {
com.ibm.etcd.api.WatchResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.ibm.etcd.api.WatchResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private com.ibm.etcd.api.ResponseHeader header_;
private com.google.protobuf.SingleFieldBuilderV3<
com.ibm.etcd.api.ResponseHeader, com.ibm.etcd.api.ResponseHeader.Builder, com.ibm.etcd.api.ResponseHeaderOrBuilder> headerBuilder_;
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return Whether the header field is set.
*/
public boolean hasHeader() {
return headerBuilder_ != null || header_ != null;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return The header.
*/
public com.ibm.etcd.api.ResponseHeader getHeader() {
if (headerBuilder_ == null) {
return header_ == null ? com.ibm.etcd.api.ResponseHeader.getDefaultInstance() : header_;
} else {
return headerBuilder_.getMessage();
}
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder setHeader(com.ibm.etcd.api.ResponseHeader value) {
if (headerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
header_ = value;
onChanged();
} else {
headerBuilder_.setMessage(value);
}
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder setHeader(
com.ibm.etcd.api.ResponseHeader.Builder builderForValue) {
if (headerBuilder_ == null) {
header_ = builderForValue.build();
onChanged();
} else {
headerBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder mergeHeader(com.ibm.etcd.api.ResponseHeader value) {
if (headerBuilder_ == null) {
if (header_ != null) {
header_ =
com.ibm.etcd.api.ResponseHeader.newBuilder(header_).mergeFrom(value).buildPartial();
} else {
header_ = value;
}
onChanged();
} else {
headerBuilder_.mergeFrom(value);
}
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder clearHeader() {
if (headerBuilder_ == null) {
header_ = null;
onChanged();
} else {
header_ = null;
headerBuilder_ = null;
}
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public com.ibm.etcd.api.ResponseHeader.Builder getHeaderBuilder() {
onChanged();
return getHeaderFieldBuilder().getBuilder();
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public com.ibm.etcd.api.ResponseHeaderOrBuilder getHeaderOrBuilder() {
if (headerBuilder_ != null) {
return headerBuilder_.getMessageOrBuilder();
} else {
return header_ == null ?
com.ibm.etcd.api.ResponseHeader.getDefaultInstance() : header_;
}
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.ibm.etcd.api.ResponseHeader, com.ibm.etcd.api.ResponseHeader.Builder, com.ibm.etcd.api.ResponseHeaderOrBuilder>
getHeaderFieldBuilder() {
if (headerBuilder_ == null) {
headerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.ibm.etcd.api.ResponseHeader, com.ibm.etcd.api.ResponseHeader.Builder, com.ibm.etcd.api.ResponseHeaderOrBuilder>(
getHeader(),
getParentForChildren(),
isClean());
header_ = null;
}
return headerBuilder_;
}
private long watchId_ ;
/**
*
* watch_id is the ID of the watcher that corresponds to the response.
*
*
* int64 watch_id = 2;
* @return The watchId.
*/
@java.lang.Override
public long getWatchId() {
return watchId_;
}
/**
*
* watch_id is the ID of the watcher that corresponds to the response.
*
*
* int64 watch_id = 2;
* @param value The watchId to set.
* @return This builder for chaining.
*/
public Builder setWatchId(long value) {
watchId_ = value;
onChanged();
return this;
}
/**
*
* watch_id is the ID of the watcher that corresponds to the response.
*
*
* int64 watch_id = 2;
* @return This builder for chaining.
*/
public Builder clearWatchId() {
watchId_ = 0L;
onChanged();
return this;
}
private boolean created_ ;
/**
*
* created is set to true if the response is for a create watch request.
* The client should record the watch_id and expect to receive events for
* the created watcher from the same stream.
* All events sent to the created watcher will attach with the same watch_id.
*
*
* bool created = 3;
* @return The created.
*/
@java.lang.Override
public boolean getCreated() {
return created_;
}
/**
*
* created is set to true if the response is for a create watch request.
* The client should record the watch_id and expect to receive events for
* the created watcher from the same stream.
* All events sent to the created watcher will attach with the same watch_id.
*
*
* bool created = 3;
* @param value The created to set.
* @return This builder for chaining.
*/
public Builder setCreated(boolean value) {
created_ = value;
onChanged();
return this;
}
/**
*
* created is set to true if the response is for a create watch request.
* The client should record the watch_id and expect to receive events for
* the created watcher from the same stream.
* All events sent to the created watcher will attach with the same watch_id.
*
*
* bool created = 3;
* @return This builder for chaining.
*/
public Builder clearCreated() {
created_ = false;
onChanged();
return this;
}
private boolean canceled_ ;
/**
*
* canceled is set to true if the response is for a cancel watch request.
* No further events will be sent to the canceled watcher.
*
*
* bool canceled = 4;
* @return The canceled.
*/
@java.lang.Override
public boolean getCanceled() {
return canceled_;
}
/**
*
* canceled is set to true if the response is for a cancel watch request.
* No further events will be sent to the canceled watcher.
*
*
* bool canceled = 4;
* @param value The canceled to set.
* @return This builder for chaining.
*/
public Builder setCanceled(boolean value) {
canceled_ = value;
onChanged();
return this;
}
/**
*
* canceled is set to true if the response is for a cancel watch request.
* No further events will be sent to the canceled watcher.
*
*
* bool canceled = 4;
* @return This builder for chaining.
*/
public Builder clearCanceled() {
canceled_ = false;
onChanged();
return this;
}
private long compactRevision_ ;
/**
*
* compact_revision is set to the minimum index if a watcher tries to watch
* at a compacted index.
* This happens when creating a watcher at a compacted revision or the watcher cannot
* catch up with the progress of the key-value store.
* The client should treat the watcher as canceled and should not try to create any
* watcher with the same start_revision again.
*
*
* int64 compact_revision = 5;
* @return The compactRevision.
*/
@java.lang.Override
public long getCompactRevision() {
return compactRevision_;
}
/**
*
* compact_revision is set to the minimum index if a watcher tries to watch
* at a compacted index.
* This happens when creating a watcher at a compacted revision or the watcher cannot
* catch up with the progress of the key-value store.
* The client should treat the watcher as canceled and should not try to create any
* watcher with the same start_revision again.
*
*
* int64 compact_revision = 5;
* @param value The compactRevision to set.
* @return This builder for chaining.
*/
public Builder setCompactRevision(long value) {
compactRevision_ = value;
onChanged();
return this;
}
/**
*
* compact_revision is set to the minimum index if a watcher tries to watch
* at a compacted index.
* This happens when creating a watcher at a compacted revision or the watcher cannot
* catch up with the progress of the key-value store.
* The client should treat the watcher as canceled and should not try to create any
* watcher with the same start_revision again.
*
*
* int64 compact_revision = 5;
* @return This builder for chaining.
*/
public Builder clearCompactRevision() {
compactRevision_ = 0L;
onChanged();
return this;
}
private java.lang.Object cancelReason_ = "";
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
* @return The cancelReason.
*/
public java.lang.String getCancelReason() {
java.lang.Object ref = cancelReason_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cancelReason_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
* @return The bytes for cancelReason.
*/
public com.google.protobuf.ByteString
getCancelReasonBytes() {
java.lang.Object ref = cancelReason_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
cancelReason_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
* @param value The cancelReason to set.
* @return This builder for chaining.
*/
public Builder setCancelReason(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
cancelReason_ = value;
onChanged();
return this;
}
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
* @return This builder for chaining.
*/
public Builder clearCancelReason() {
cancelReason_ = getDefaultInstance().getCancelReason();
onChanged();
return this;
}
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
* @param value The bytes for cancelReason to set.
* @return This builder for chaining.
*/
public Builder setCancelReasonBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
cancelReason_ = value;
onChanged();
return this;
}
private boolean fragment_ ;
/**
*
* framgment is true if large watch response was split over multiple responses.
*
*
* bool fragment = 7;
* @return The fragment.
*/
@java.lang.Override
public boolean getFragment() {
return fragment_;
}
/**
*
* framgment is true if large watch response was split over multiple responses.
*
*
* bool fragment = 7;
* @param value The fragment to set.
* @return This builder for chaining.
*/
public Builder setFragment(boolean value) {
fragment_ = value;
onChanged();
return this;
}
/**
*
* framgment is true if large watch response was split over multiple responses.
*
*
* bool fragment = 7;
* @return This builder for chaining.
*/
public Builder clearFragment() {
fragment_ = false;
onChanged();
return this;
}
private java.util.List events_ =
java.util.Collections.emptyList();
private void ensureEventsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
events_ = new java.util.ArrayList(events_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.ibm.etcd.api.Event, com.ibm.etcd.api.Event.Builder, com.ibm.etcd.api.EventOrBuilder> eventsBuilder_;
/**
* repeated .mvccpb.Event events = 11;
*/
public java.util.List getEventsList() {
if (eventsBuilder_ == null) {
return java.util.Collections.unmodifiableList(events_);
} else {
return eventsBuilder_.getMessageList();
}
}
/**
* repeated .mvccpb.Event events = 11;
*/
public int getEventsCount() {
if (eventsBuilder_ == null) {
return events_.size();
} else {
return eventsBuilder_.getCount();
}
}
/**
* repeated .mvccpb.Event events = 11;
*/
public com.ibm.etcd.api.Event getEvents(int index) {
if (eventsBuilder_ == null) {
return events_.get(index);
} else {
return eventsBuilder_.getMessage(index);
}
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder setEvents(
int index, com.ibm.etcd.api.Event value) {
if (eventsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEventsIsMutable();
events_.set(index, value);
onChanged();
} else {
eventsBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder setEvents(
int index, com.ibm.etcd.api.Event.Builder builderForValue) {
if (eventsBuilder_ == null) {
ensureEventsIsMutable();
events_.set(index, builderForValue.build());
onChanged();
} else {
eventsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder addEvents(com.ibm.etcd.api.Event value) {
if (eventsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEventsIsMutable();
events_.add(value);
onChanged();
} else {
eventsBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder addEvents(
int index, com.ibm.etcd.api.Event value) {
if (eventsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEventsIsMutable();
events_.add(index, value);
onChanged();
} else {
eventsBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder addEvents(
com.ibm.etcd.api.Event.Builder builderForValue) {
if (eventsBuilder_ == null) {
ensureEventsIsMutable();
events_.add(builderForValue.build());
onChanged();
} else {
eventsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder addEvents(
int index, com.ibm.etcd.api.Event.Builder builderForValue) {
if (eventsBuilder_ == null) {
ensureEventsIsMutable();
events_.add(index, builderForValue.build());
onChanged();
} else {
eventsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder addAllEvents(
java.lang.Iterable extends com.ibm.etcd.api.Event> values) {
if (eventsBuilder_ == null) {
ensureEventsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, events_);
onChanged();
} else {
eventsBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder clearEvents() {
if (eventsBuilder_ == null) {
events_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
eventsBuilder_.clear();
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public Builder removeEvents(int index) {
if (eventsBuilder_ == null) {
ensureEventsIsMutable();
events_.remove(index);
onChanged();
} else {
eventsBuilder_.remove(index);
}
return this;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public com.ibm.etcd.api.Event.Builder getEventsBuilder(
int index) {
return getEventsFieldBuilder().getBuilder(index);
}
/**
* repeated .mvccpb.Event events = 11;
*/
public com.ibm.etcd.api.EventOrBuilder getEventsOrBuilder(
int index) {
if (eventsBuilder_ == null) {
return events_.get(index); } else {
return eventsBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .mvccpb.Event events = 11;
*/
public java.util.List extends com.ibm.etcd.api.EventOrBuilder>
getEventsOrBuilderList() {
if (eventsBuilder_ != null) {
return eventsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(events_);
}
}
/**
* repeated .mvccpb.Event events = 11;
*/
public com.ibm.etcd.api.Event.Builder addEventsBuilder() {
return getEventsFieldBuilder().addBuilder(
com.ibm.etcd.api.Event.getDefaultInstance());
}
/**
* repeated .mvccpb.Event events = 11;
*/
public com.ibm.etcd.api.Event.Builder addEventsBuilder(
int index) {
return getEventsFieldBuilder().addBuilder(
index, com.ibm.etcd.api.Event.getDefaultInstance());
}
/**
* repeated .mvccpb.Event events = 11;
*/
public java.util.List
getEventsBuilderList() {
return getEventsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.ibm.etcd.api.Event, com.ibm.etcd.api.Event.Builder, com.ibm.etcd.api.EventOrBuilder>
getEventsFieldBuilder() {
if (eventsBuilder_ == null) {
eventsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.ibm.etcd.api.Event, com.ibm.etcd.api.Event.Builder, com.ibm.etcd.api.EventOrBuilder>(
events_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
events_ = null;
}
return eventsBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:etcdserverpb.WatchResponse)
}
// @@protoc_insertion_point(class_scope:etcdserverpb.WatchResponse)
private static final com.ibm.etcd.api.WatchResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.ibm.etcd.api.WatchResponse();
}
public static com.ibm.etcd.api.WatchResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public WatchResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new WatchResponse(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 com.ibm.etcd.api.WatchResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}