io.etcd.jetcd.api.Event Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: kv.proto
// Protobuf Java Version: 3.25.1
package io.etcd.jetcd.api;
/**
* Protobuf type {@code mvccpb.Event}
*/
public final class Event extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:mvccpb.Event)
EventOrBuilder {
private static final long serialVersionUID = 0L;
// Use Event.newBuilder() to construct.
private Event(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Event() {
type_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Event();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.etcd.jetcd.api.Kv.internal_static_mvccpb_Event_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.etcd.jetcd.api.Kv.internal_static_mvccpb_Event_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.etcd.jetcd.api.Event.class, io.etcd.jetcd.api.Event.Builder.class);
}
/**
* Protobuf enum {@code mvccpb.Event.EventType}
*/
public enum EventType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* PUT = 0;
*/
PUT(0),
/**
* DELETE = 1;
*/
DELETE(1),
UNRECOGNIZED(-1),
;
/**
* PUT = 0;
*/
public static final int PUT_VALUE = 0;
/**
* DELETE = 1;
*/
public static final int DELETE_VALUE = 1;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static EventType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static EventType forNumber(int value) {
switch (value) {
case 0: return PUT;
case 1: return DELETE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
EventType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public EventType findValueByNumber(int number) {
return EventType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.etcd.jetcd.api.Event.getDescriptor().getEnumTypes().get(0);
}
private static final EventType[] VALUES = values();
public static EventType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private EventType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:mvccpb.Event.EventType)
}
private int bitField0_;
public static final int TYPE_FIELD_NUMBER = 1;
private int type_ = 0;
/**
*
* type is the kind of event. If type is a PUT, it indicates
* new data has been stored to the key. If type is a DELETE,
* it indicates the key was deleted.
*
*
* .mvccpb.Event.EventType type = 1;
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override public int getTypeValue() {
return type_;
}
/**
*
* type is the kind of event. If type is a PUT, it indicates
* new data has been stored to the key. If type is a DELETE,
* it indicates the key was deleted.
*
*
* .mvccpb.Event.EventType type = 1;
* @return The type.
*/
@java.lang.Override public io.etcd.jetcd.api.Event.EventType getType() {
io.etcd.jetcd.api.Event.EventType result = io.etcd.jetcd.api.Event.EventType.forNumber(type_);
return result == null ? io.etcd.jetcd.api.Event.EventType.UNRECOGNIZED : result;
}
public static final int KV_FIELD_NUMBER = 2;
private io.etcd.jetcd.api.KeyValue kv_;
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
* @return Whether the kv field is set.
*/
@java.lang.Override
public boolean hasKv() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
* @return The kv.
*/
@java.lang.Override
public io.etcd.jetcd.api.KeyValue getKv() {
return kv_ == null ? io.etcd.jetcd.api.KeyValue.getDefaultInstance() : kv_;
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
@java.lang.Override
public io.etcd.jetcd.api.KeyValueOrBuilder getKvOrBuilder() {
return kv_ == null ? io.etcd.jetcd.api.KeyValue.getDefaultInstance() : kv_;
}
public static final int PREV_KV_FIELD_NUMBER = 3;
private io.etcd.jetcd.api.KeyValue prevKv_;
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
* @return Whether the prevKv field is set.
*/
@java.lang.Override
public boolean hasPrevKv() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
* @return The prevKv.
*/
@java.lang.Override
public io.etcd.jetcd.api.KeyValue getPrevKv() {
return prevKv_ == null ? io.etcd.jetcd.api.KeyValue.getDefaultInstance() : prevKv_;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
@java.lang.Override
public io.etcd.jetcd.api.KeyValueOrBuilder getPrevKvOrBuilder() {
return prevKv_ == null ? io.etcd.jetcd.api.KeyValue.getDefaultInstance() : prevKv_;
}
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 (type_ != io.etcd.jetcd.api.Event.EventType.PUT.getNumber()) {
output.writeEnum(1, type_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getKv());
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(3, getPrevKv());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != io.etcd.jetcd.api.Event.EventType.PUT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, type_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getKv());
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getPrevKv());
}
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.Event)) {
return super.equals(obj);
}
io.etcd.jetcd.api.Event other = (io.etcd.jetcd.api.Event) obj;
if (type_ != other.type_) return false;
if (hasKv() != other.hasKv()) return false;
if (hasKv()) {
if (!getKv()
.equals(other.getKv())) return false;
}
if (hasPrevKv() != other.hasPrevKv()) return false;
if (hasPrevKv()) {
if (!getPrevKv()
.equals(other.getPrevKv())) 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();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
if (hasKv()) {
hash = (37 * hash) + KV_FIELD_NUMBER;
hash = (53 * hash) + getKv().hashCode();
}
if (hasPrevKv()) {
hash = (37 * hash) + PREV_KV_FIELD_NUMBER;
hash = (53 * hash) + getPrevKv().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.etcd.jetcd.api.Event parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.Event 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.Event parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.Event 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.Event parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.Event parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.etcd.jetcd.api.Event parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.etcd.jetcd.api.Event 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.Event parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.etcd.jetcd.api.Event 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.Event parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.etcd.jetcd.api.Event 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.Event 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 mvccpb.Event}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:mvccpb.Event)
io.etcd.jetcd.api.EventOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.etcd.jetcd.api.Kv.internal_static_mvccpb_Event_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.etcd.jetcd.api.Kv.internal_static_mvccpb_Event_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.etcd.jetcd.api.Event.class, io.etcd.jetcd.api.Event.Builder.class);
}
// Construct using io.etcd.jetcd.api.Event.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getKvFieldBuilder();
getPrevKvFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
type_ = 0;
kv_ = null;
if (kvBuilder_ != null) {
kvBuilder_.dispose();
kvBuilder_ = null;
}
prevKv_ = null;
if (prevKvBuilder_ != null) {
prevKvBuilder_.dispose();
prevKvBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.etcd.jetcd.api.Kv.internal_static_mvccpb_Event_descriptor;
}
@java.lang.Override
public io.etcd.jetcd.api.Event getDefaultInstanceForType() {
return io.etcd.jetcd.api.Event.getDefaultInstance();
}
@java.lang.Override
public io.etcd.jetcd.api.Event build() {
io.etcd.jetcd.api.Event result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.etcd.jetcd.api.Event buildPartial() {
io.etcd.jetcd.api.Event result = new io.etcd.jetcd.api.Event(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(io.etcd.jetcd.api.Event result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.type_ = type_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.kv_ = kvBuilder_ == null
? kv_
: kvBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.prevKv_ = prevKvBuilder_ == null
? prevKv_
: prevKvBuilder_.build();
to_bitField0_ |= 0x00000002;
}
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.Event) {
return mergeFrom((io.etcd.jetcd.api.Event)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.etcd.jetcd.api.Event other) {
if (other == io.etcd.jetcd.api.Event.getDefaultInstance()) return this;
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.hasKv()) {
mergeKv(other.getKv());
}
if (other.hasPrevKv()) {
mergePrevKv(other.getPrevKv());
}
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 8: {
type_ = input.readEnum();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
input.readMessage(
getKvFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 26: {
input.readMessage(
getPrevKvFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 26
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 int type_ = 0;
/**
*
* type is the kind of event. If type is a PUT, it indicates
* new data has been stored to the key. If type is a DELETE,
* it indicates the key was deleted.
*
*
* .mvccpb.Event.EventType type = 1;
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override public int getTypeValue() {
return type_;
}
/**
*
* type is the kind of event. If type is a PUT, it indicates
* new data has been stored to the key. If type is a DELETE,
* it indicates the key was deleted.
*
*
* .mvccpb.Event.EventType type = 1;
* @param value The enum numeric value on the wire for type to set.
* @return This builder for chaining.
*/
public Builder setTypeValue(int value) {
type_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* type is the kind of event. If type is a PUT, it indicates
* new data has been stored to the key. If type is a DELETE,
* it indicates the key was deleted.
*
*
* .mvccpb.Event.EventType type = 1;
* @return The type.
*/
@java.lang.Override
public io.etcd.jetcd.api.Event.EventType getType() {
io.etcd.jetcd.api.Event.EventType result = io.etcd.jetcd.api.Event.EventType.forNumber(type_);
return result == null ? io.etcd.jetcd.api.Event.EventType.UNRECOGNIZED : result;
}
/**
*
* type is the kind of event. If type is a PUT, it indicates
* new data has been stored to the key. If type is a DELETE,
* it indicates the key was deleted.
*
*
* .mvccpb.Event.EventType type = 1;
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(io.etcd.jetcd.api.Event.EventType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
* type is the kind of event. If type is a PUT, it indicates
* new data has been stored to the key. If type is a DELETE,
* it indicates the key was deleted.
*
*
* .mvccpb.Event.EventType type = 1;
* @return This builder for chaining.
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000001);
type_ = 0;
onChanged();
return this;
}
private io.etcd.jetcd.api.KeyValue kv_;
private com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.KeyValue, io.etcd.jetcd.api.KeyValue.Builder, io.etcd.jetcd.api.KeyValueOrBuilder> kvBuilder_;
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
* @return Whether the kv field is set.
*/
public boolean hasKv() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
* @return The kv.
*/
public io.etcd.jetcd.api.KeyValue getKv() {
if (kvBuilder_ == null) {
return kv_ == null ? io.etcd.jetcd.api.KeyValue.getDefaultInstance() : kv_;
} else {
return kvBuilder_.getMessage();
}
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
public Builder setKv(io.etcd.jetcd.api.KeyValue value) {
if (kvBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
kv_ = value;
} else {
kvBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
public Builder setKv(
io.etcd.jetcd.api.KeyValue.Builder builderForValue) {
if (kvBuilder_ == null) {
kv_ = builderForValue.build();
} else {
kvBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
public Builder mergeKv(io.etcd.jetcd.api.KeyValue value) {
if (kvBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
kv_ != null &&
kv_ != io.etcd.jetcd.api.KeyValue.getDefaultInstance()) {
getKvBuilder().mergeFrom(value);
} else {
kv_ = value;
}
} else {
kvBuilder_.mergeFrom(value);
}
if (kv_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
public Builder clearKv() {
bitField0_ = (bitField0_ & ~0x00000002);
kv_ = null;
if (kvBuilder_ != null) {
kvBuilder_.dispose();
kvBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
public io.etcd.jetcd.api.KeyValue.Builder getKvBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getKvFieldBuilder().getBuilder();
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
public io.etcd.jetcd.api.KeyValueOrBuilder getKvOrBuilder() {
if (kvBuilder_ != null) {
return kvBuilder_.getMessageOrBuilder();
} else {
return kv_ == null ?
io.etcd.jetcd.api.KeyValue.getDefaultInstance() : kv_;
}
}
/**
*
* kv holds the KeyValue for the event.
* A PUT event contains current kv pair.
* A PUT event with kv.Version=1 indicates the creation of a key.
* A DELETE/EXPIRE event contains the deleted key with
* its modification revision set to the revision of deletion.
*
*
* .mvccpb.KeyValue kv = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.KeyValue, io.etcd.jetcd.api.KeyValue.Builder, io.etcd.jetcd.api.KeyValueOrBuilder>
getKvFieldBuilder() {
if (kvBuilder_ == null) {
kvBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.KeyValue, io.etcd.jetcd.api.KeyValue.Builder, io.etcd.jetcd.api.KeyValueOrBuilder>(
getKv(),
getParentForChildren(),
isClean());
kv_ = null;
}
return kvBuilder_;
}
private io.etcd.jetcd.api.KeyValue prevKv_;
private com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.KeyValue, io.etcd.jetcd.api.KeyValue.Builder, io.etcd.jetcd.api.KeyValueOrBuilder> prevKvBuilder_;
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
* @return Whether the prevKv field is set.
*/
public boolean hasPrevKv() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
* @return The prevKv.
*/
public io.etcd.jetcd.api.KeyValue getPrevKv() {
if (prevKvBuilder_ == null) {
return prevKv_ == null ? io.etcd.jetcd.api.KeyValue.getDefaultInstance() : prevKv_;
} else {
return prevKvBuilder_.getMessage();
}
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public Builder setPrevKv(io.etcd.jetcd.api.KeyValue value) {
if (prevKvBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
prevKv_ = value;
} else {
prevKvBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public Builder setPrevKv(
io.etcd.jetcd.api.KeyValue.Builder builderForValue) {
if (prevKvBuilder_ == null) {
prevKv_ = builderForValue.build();
} else {
prevKvBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public Builder mergePrevKv(io.etcd.jetcd.api.KeyValue value) {
if (prevKvBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0) &&
prevKv_ != null &&
prevKv_ != io.etcd.jetcd.api.KeyValue.getDefaultInstance()) {
getPrevKvBuilder().mergeFrom(value);
} else {
prevKv_ = value;
}
} else {
prevKvBuilder_.mergeFrom(value);
}
if (prevKv_ != null) {
bitField0_ |= 0x00000004;
onChanged();
}
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public Builder clearPrevKv() {
bitField0_ = (bitField0_ & ~0x00000004);
prevKv_ = null;
if (prevKvBuilder_ != null) {
prevKvBuilder_.dispose();
prevKvBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public io.etcd.jetcd.api.KeyValue.Builder getPrevKvBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getPrevKvFieldBuilder().getBuilder();
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public io.etcd.jetcd.api.KeyValueOrBuilder getPrevKvOrBuilder() {
if (prevKvBuilder_ != null) {
return prevKvBuilder_.getMessageOrBuilder();
} else {
return prevKv_ == null ?
io.etcd.jetcd.api.KeyValue.getDefaultInstance() : prevKv_;
}
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.KeyValue, io.etcd.jetcd.api.KeyValue.Builder, io.etcd.jetcd.api.KeyValueOrBuilder>
getPrevKvFieldBuilder() {
if (prevKvBuilder_ == null) {
prevKvBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.etcd.jetcd.api.KeyValue, io.etcd.jetcd.api.KeyValue.Builder, io.etcd.jetcd.api.KeyValueOrBuilder>(
getPrevKv(),
getParentForChildren(),
isClean());
prevKv_ = null;
}
return prevKvBuilder_;
}
@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:mvccpb.Event)
}
// @@protoc_insertion_point(class_scope:mvccpb.Event)
private static final io.etcd.jetcd.api.Event DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.etcd.jetcd.api.Event();
}
public static io.etcd.jetcd.api.Event getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Event 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.Event getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}