io.etcd.jetcd.api.WatchResponse Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: rpc.proto
// Protobuf Java Version: 3.25.1
package io.etcd.jetcd.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();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_WatchResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_WatchResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.etcd.jetcd.api.WatchResponse.class, io.etcd.jetcd.api.WatchResponse.Builder.class);
}
private int bitField0_;
public static final int HEADER_FIELD_NUMBER = 1;
private io.etcd.jetcd.api.ResponseHeader header_;
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return Whether the header field is set.
*/
@java.lang.Override
public boolean hasHeader() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return The header.
*/
@java.lang.Override
public io.etcd.jetcd.api.ResponseHeader getHeader() {
return header_ == null ? io.etcd.jetcd.api.ResponseHeader.getDefaultInstance() : header_;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
@java.lang.Override
public io.etcd.jetcd.api.ResponseHeaderOrBuilder getHeaderOrBuilder() {
return header_ == null ? io.etcd.jetcd.api.ResponseHeader.getDefaultInstance() : header_;
}
public static final int WATCH_ID_FIELD_NUMBER = 2;
private long watchId_ = 0L;
/**
*
* 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_ = false;
/**
*
* 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_ = false;
/**
*
* 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_ = 0L;
/**
*
* 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;
@SuppressWarnings("serial")
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 EVENTS_FIELD_NUMBER = 11;
@SuppressWarnings("serial")
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 io.etcd.jetcd.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 io.etcd.jetcd.api.Event getEvents(int index) {
return events_.get(index);
}
/**
* repeated .mvccpb.Event events = 11;
*/
@java.lang.Override
public io.etcd.jetcd.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 (((bitField0_ & 0x00000001) != 0)) {
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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cancelReason_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, cancelReason_);
}
for (int i = 0; i < events_.size(); i++) {
output.writeMessage(11, events_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cancelReason_)) {
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 += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.etcd.jetcd.api.WatchResponse)) {
return super.equals(obj);
}
io.etcd.jetcd.api.WatchResponse other = (io.etcd.jetcd.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 (!getEventsList()
.equals(other.getEventsList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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();
if (getEventsCount() > 0) {
hash = (37 * hash) + EVENTS_FIELD_NUMBER;
hash = (53 * hash) + getEventsList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.etcd.jetcd.api.WatchResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.WatchResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.etcd.jetcd.api.WatchResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.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 io.etcd.jetcd.api.WatchResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.WatchResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.etcd.jetcd.api.WatchResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.etcd.jetcd.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 io.etcd.jetcd.api.WatchResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.etcd.jetcd.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 io.etcd.jetcd.api.WatchResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.etcd.jetcd.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(io.etcd.jetcd.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)
io.etcd.jetcd.api.WatchResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_WatchResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_WatchResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.etcd.jetcd.api.WatchResponse.class, io.etcd.jetcd.api.WatchResponse.Builder.class);
}
// Construct using io.etcd.jetcd.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) {
getHeaderFieldBuilder();
getEventsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
header_ = null;
if (headerBuilder_ != null) {
headerBuilder_.dispose();
headerBuilder_ = null;
}
watchId_ = 0L;
created_ = false;
canceled_ = false;
compactRevision_ = 0L;
cancelReason_ = "";
if (eventsBuilder_ == null) {
events_ = java.util.Collections.emptyList();
} else {
events_ = null;
eventsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_WatchResponse_descriptor;
}
@java.lang.Override
public io.etcd.jetcd.api.WatchResponse getDefaultInstanceForType() {
return io.etcd.jetcd.api.WatchResponse.getDefaultInstance();
}
@java.lang.Override
public io.etcd.jetcd.api.WatchResponse build() {
io.etcd.jetcd.api.WatchResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.etcd.jetcd.api.WatchResponse buildPartial() {
io.etcd.jetcd.api.WatchResponse result = new io.etcd.jetcd.api.WatchResponse(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(io.etcd.jetcd.api.WatchResponse result) {
if (eventsBuilder_ == null) {
if (((bitField0_ & 0x00000040) != 0)) {
events_ = java.util.Collections.unmodifiableList(events_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.events_ = events_;
} else {
result.events_ = eventsBuilder_.build();
}
}
private void buildPartial0(io.etcd.jetcd.api.WatchResponse result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.header_ = headerBuilder_ == null
? header_
: headerBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.watchId_ = watchId_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.created_ = created_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.canceled_ = canceled_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.compactRevision_ = compactRevision_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.cancelReason_ = cancelReason_;
}
result.bitField0_ |= to_bitField0_;
}
@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 io.etcd.jetcd.api.WatchResponse) {
return mergeFrom((io.etcd.jetcd.api.WatchResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.etcd.jetcd.api.WatchResponse other) {
if (other == io.etcd.jetcd.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_;
bitField0_ |= 0x00000020;
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.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getHeaderFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
watchId_ = input.readInt64();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
created_ = input.readBool();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
canceled_ = input.readBool();
bitField0_ |= 0x00000008;
break;
} // case 32
case 40: {
compactRevision_ = input.readInt64();
bitField0_ |= 0x00000010;
break;
} // case 40
case 50: {
cancelReason_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000020;
break;
} // case 50
case 90: {
io.etcd.jetcd.api.Event m =
input.readMessage(
io.etcd.jetcd.api.Event.parser(),
extensionRegistry);
if (eventsBuilder_ == null) {
ensureEventsIsMutable();
events_.add(m);
} else {
eventsBuilder_.addMessage(m);
}
break;
} // case 90
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private io.etcd.jetcd.api.ResponseHeader header_;
private com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.ResponseHeader, io.etcd.jetcd.api.ResponseHeader.Builder, io.etcd.jetcd.api.ResponseHeaderOrBuilder> headerBuilder_;
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return Whether the header field is set.
*/
public boolean hasHeader() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* .etcdserverpb.ResponseHeader header = 1;
* @return The header.
*/
public io.etcd.jetcd.api.ResponseHeader getHeader() {
if (headerBuilder_ == null) {
return header_ == null ? io.etcd.jetcd.api.ResponseHeader.getDefaultInstance() : header_;
} else {
return headerBuilder_.getMessage();
}
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder setHeader(io.etcd.jetcd.api.ResponseHeader value) {
if (headerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
header_ = value;
} else {
headerBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder setHeader(
io.etcd.jetcd.api.ResponseHeader.Builder builderForValue) {
if (headerBuilder_ == null) {
header_ = builderForValue.build();
} else {
headerBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder mergeHeader(io.etcd.jetcd.api.ResponseHeader value) {
if (headerBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
header_ != null &&
header_ != io.etcd.jetcd.api.ResponseHeader.getDefaultInstance()) {
getHeaderBuilder().mergeFrom(value);
} else {
header_ = value;
}
} else {
headerBuilder_.mergeFrom(value);
}
if (header_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public Builder clearHeader() {
bitField0_ = (bitField0_ & ~0x00000001);
header_ = null;
if (headerBuilder_ != null) {
headerBuilder_.dispose();
headerBuilder_ = null;
}
onChanged();
return this;
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public io.etcd.jetcd.api.ResponseHeader.Builder getHeaderBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getHeaderFieldBuilder().getBuilder();
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
public io.etcd.jetcd.api.ResponseHeaderOrBuilder getHeaderOrBuilder() {
if (headerBuilder_ != null) {
return headerBuilder_.getMessageOrBuilder();
} else {
return header_ == null ?
io.etcd.jetcd.api.ResponseHeader.getDefaultInstance() : header_;
}
}
/**
* .etcdserverpb.ResponseHeader header = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.ResponseHeader, io.etcd.jetcd.api.ResponseHeader.Builder, io.etcd.jetcd.api.ResponseHeaderOrBuilder>
getHeaderFieldBuilder() {
if (headerBuilder_ == null) {
headerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.ResponseHeader, io.etcd.jetcd.api.ResponseHeader.Builder, io.etcd.jetcd.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;
bitField0_ |= 0x00000002;
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() {
bitField0_ = (bitField0_ & ~0x00000002);
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;
bitField0_ |= 0x00000004;
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() {
bitField0_ = (bitField0_ & ~0x00000004);
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;
bitField0_ |= 0x00000008;
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() {
bitField0_ = (bitField0_ & ~0x00000008);
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;
bitField0_ |= 0x00000010;
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() {
bitField0_ = (bitField0_ & ~0x00000010);
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;
bitField0_ |= 0x00000020;
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();
bitField0_ = (bitField0_ & ~0x00000020);
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;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
private java.util.List events_ =
java.util.Collections.emptyList();
private void ensureEventsIsMutable() {
if (!((bitField0_ & 0x00000040) != 0)) {
events_ = new java.util.ArrayList(events_);
bitField0_ |= 0x00000040;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.etcd.jetcd.api.Event, io.etcd.jetcd.api.Event.Builder, io.etcd.jetcd.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 io.etcd.jetcd.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, io.etcd.jetcd.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, io.etcd.jetcd.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(io.etcd.jetcd.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, io.etcd.jetcd.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(
io.etcd.jetcd.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, io.etcd.jetcd.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 io.etcd.jetcd.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 io.etcd.jetcd.api.Event.Builder getEventsBuilder(
int index) {
return getEventsFieldBuilder().getBuilder(index);
}
/**
* repeated .mvccpb.Event events = 11;
*/
public io.etcd.jetcd.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 io.etcd.jetcd.api.EventOrBuilder>
getEventsOrBuilderList() {
if (eventsBuilder_ != null) {
return eventsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(events_);
}
}
/**
* repeated .mvccpb.Event events = 11;
*/
public io.etcd.jetcd.api.Event.Builder addEventsBuilder() {
return getEventsFieldBuilder().addBuilder(
io.etcd.jetcd.api.Event.getDefaultInstance());
}
/**
* repeated .mvccpb.Event events = 11;
*/
public io.etcd.jetcd.api.Event.Builder addEventsBuilder(
int index) {
return getEventsFieldBuilder().addBuilder(
index, io.etcd.jetcd.api.Event.getDefaultInstance());
}
/**
* repeated .mvccpb.Event events = 11;
*/
public java.util.List
getEventsBuilderList() {
return getEventsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.etcd.jetcd.api.Event, io.etcd.jetcd.api.Event.Builder, io.etcd.jetcd.api.EventOrBuilder>
getEventsFieldBuilder() {
if (eventsBuilder_ == null) {
eventsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.etcd.jetcd.api.Event, io.etcd.jetcd.api.Event.Builder, io.etcd.jetcd.api.EventOrBuilder>(
events_,
((bitField0_ & 0x00000040) != 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 io.etcd.jetcd.api.WatchResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.etcd.jetcd.api.WatchResponse();
}
public static io.etcd.jetcd.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 {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.etcd.jetcd.api.WatchResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}