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() {
watchId_ = 0L;
created_ = false;
canceled_ = false;
compactRevision_ = 0L;
cancelReason_ = "";
events_ = java.util.Collections.emptyList();
}
@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;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
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 90: {
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
events_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000040;
}
events_.add(
input.readMessage(com.ibm.etcd.api.Event.parser(), extensionRegistry));
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_ & 0x00000040) == 0x00000040)) {
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;
}
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);
}
private int bitField0_;
public static final int HEADER_FIELD_NUMBER = 1;
private com.ibm.etcd.api.ResponseHeader header_;
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public boolean hasHeader() {
return header_ != null;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public com.ibm.etcd.api.ResponseHeader getHeader() {
return header_ == null ? com.ibm.etcd.api.ResponseHeader.getDefaultInstance() : header_;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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 EVENTS_FIELD_NUMBER = 11;
private java.util.List events_;
/**
* repeated .mvccpb.Event events = 11;
*/
public java.util.List getEventsList() {
return events_;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public java.util.List extends com.ibm.etcd.api.EventOrBuilder>
getEventsOrBuilderList() {
return events_;
}
/**
* repeated .mvccpb.Event events = 11;
*/
public int getEventsCount() {
return events_.size();
}
/**
* repeated .mvccpb.Event events = 11;
*/
public com.ibm.etcd.api.Event getEvents(int index) {
return events_.get(index);
}
/**
* repeated .mvccpb.Event events = 11;
*/
public com.ibm.etcd.api.EventOrBuilder getEventsOrBuilder(
int index) {
return events_.get(index);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
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_);
}
for (int i = 0; i < events_.size(); i++) {
output.writeMessage(11, events_.get(i));
}
unknownFields.writeTo(output);
}
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_);
}
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;
boolean result = true;
result = result && (hasHeader() == other.hasHeader());
if (hasHeader()) {
result = result && getHeader()
.equals(other.getHeader());
}
result = result && (getWatchId()
== other.getWatchId());
result = result && (getCreated()
== other.getCreated());
result = result && (getCanceled()
== other.getCanceled());
result = result && (getCompactRevision()
== other.getCompactRevision());
result = result && getCancelReason()
.equals(other.getCancelReason());
result = result && getEventsList()
.equals(other.getEventsList());
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();
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();
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);
}
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);
}
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;
}
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();
}
}
public Builder clear() {
super.clear();
if (headerBuilder_ == null) {
header_ = null;
} else {
header_ = null;
headerBuilder_ = null;
}
watchId_ = 0L;
created_ = false;
canceled_ = false;
compactRevision_ = 0L;
cancelReason_ = "";
if (eventsBuilder_ == null) {
events_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
} else {
eventsBuilder_.clear();
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_WatchResponse_descriptor;
}
public com.ibm.etcd.api.WatchResponse getDefaultInstanceForType() {
return com.ibm.etcd.api.WatchResponse.getDefaultInstance();
}
public com.ibm.etcd.api.WatchResponse build() {
com.ibm.etcd.api.WatchResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.ibm.etcd.api.WatchResponse buildPartial() {
com.ibm.etcd.api.WatchResponse result = new com.ibm.etcd.api.WatchResponse(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
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_;
if (eventsBuilder_ == null) {
if (((bitField0_ & 0x00000040) == 0x00000040)) {
events_ = java.util.Collections.unmodifiableList(events_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.events_ = events_;
} else {
result.events_ = eventsBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
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 (eventsBuilder_ == null) {
if (!other.events_.isEmpty()) {
if (events_.isEmpty()) {
events_ = other.events_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureEventsIsMutable();
events_.addAll(other.events_);
}
onChanged();
}
} else {
if (!other.events_.isEmpty()) {
if (eventsBuilder_.isEmpty()) {
eventsBuilder_.dispose();
eventsBuilder_ = null;
events_ = other.events_;
bitField0_ = (bitField0_ & ~0x00000040);
eventsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getEventsFieldBuilder() : null;
} else {
eventsBuilder_.addAllMessages(other.events_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
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_ = null;
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;
*/
public boolean hasHeader() {
return headerBuilder_ != null || header_ != null;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
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;
*/
public long getWatchId() {
return watchId_;
}
/**
*
* watch_id is the ID of the watcher that corresponds to the response.
*
*
* int64 watch_id = 2;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
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;
*/
public Builder clearCancelReason() {
cancelReason_ = getDefaultInstance().getCancelReason();
onChanged();
return this;
}
/**
*
* cancel_reason indicates the reason for canceling the watcher.
*
*
* string cancel_reason = 6;
*/
public Builder setCancelReasonBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
cancelReason_ = value;
onChanged();
return this;
}
private java.util.List events_ =
java.util.Collections.emptyList();
private void ensureEventsIsMutable() {
if (!((bitField0_ & 0x00000040) == 0x00000040)) {
events_ = new java.util.ArrayList(events_);
bitField0_ |= 0x00000040;
}
}
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_ & ~0x00000040);
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_ & 0x00000040) == 0x00000040),
getParentForChildren(),
isClean());
events_ = null;
}
return eventsBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
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() {
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;
}
public com.ibm.etcd.api.WatchResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}