com.ibm.etcd.api.Event 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: kv.proto
package com.ibm.etcd.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();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Event(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
type_ = rawValue;
break;
}
case 18: {
com.ibm.etcd.api.KeyValue.Builder subBuilder = null;
if (kv_ != null) {
subBuilder = kv_.toBuilder();
}
kv_ = input.readMessage(com.ibm.etcd.api.KeyValue.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(kv_);
kv_ = subBuilder.buildPartial();
}
break;
}
case 26: {
com.ibm.etcd.api.KeyValue.Builder subBuilder = null;
if (prevKv_ != null) {
subBuilder = prevKv_.toBuilder();
}
prevKv_ = input.readMessage(com.ibm.etcd.api.KeyValue.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(prevKv_);
prevKv_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_Event_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_Event_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.Event.class, com.ibm.etcd.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 com.ibm.etcd.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)
}
public static final int TYPE_FIELD_NUMBER = 1;
private int 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 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 com.ibm.etcd.api.Event.EventType getType() {
@SuppressWarnings("deprecation")
com.ibm.etcd.api.Event.EventType result = com.ibm.etcd.api.Event.EventType.valueOf(type_);
return result == null ? com.ibm.etcd.api.Event.EventType.UNRECOGNIZED : result;
}
public static final int KV_FIELD_NUMBER = 2;
private com.ibm.etcd.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 kv_ != null;
}
/**
*
* 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 com.ibm.etcd.api.KeyValue getKv() {
return kv_ == null ? com.ibm.etcd.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 com.ibm.etcd.api.KeyValueOrBuilder getKvOrBuilder() {
return getKv();
}
public static final int PREV_KV_FIELD_NUMBER = 3;
private com.ibm.etcd.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 prevKv_ != null;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
* @return The prevKv.
*/
@java.lang.Override
public com.ibm.etcd.api.KeyValue getPrevKv() {
return prevKv_ == null ? com.ibm.etcd.api.KeyValue.getDefaultInstance() : prevKv_;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
@java.lang.Override
public com.ibm.etcd.api.KeyValueOrBuilder getPrevKvOrBuilder() {
return getPrevKv();
}
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_ != com.ibm.etcd.api.Event.EventType.PUT.getNumber()) {
output.writeEnum(1, type_);
}
if (kv_ != null) {
output.writeMessage(2, getKv());
}
if (prevKv_ != null) {
output.writeMessage(3, getPrevKv());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != com.ibm.etcd.api.Event.EventType.PUT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, type_);
}
if (kv_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getKv());
}
if (prevKv_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getPrevKv());
}
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.Event)) {
return super.equals(obj);
}
com.ibm.etcd.api.Event other = (com.ibm.etcd.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 (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
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) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.ibm.etcd.api.Event parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.Event 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.Event parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.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 com.ibm.etcd.api.Event parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.Event parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ibm.etcd.api.Event parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.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 com.ibm.etcd.api.Event parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.ibm.etcd.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 com.ibm.etcd.api.Event parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.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(com.ibm.etcd.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)
com.ibm.etcd.api.EventOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_Event_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_Event_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.Event.class, com.ibm.etcd.api.Event.Builder.class);
}
// Construct using com.ibm.etcd.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) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
type_ = 0;
if (kvBuilder_ == null) {
kv_ = null;
} else {
kv_ = null;
kvBuilder_ = null;
}
if (prevKvBuilder_ == null) {
prevKv_ = null;
} else {
prevKv_ = null;
prevKvBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_Event_descriptor;
}
@java.lang.Override
public com.ibm.etcd.api.Event getDefaultInstanceForType() {
return com.ibm.etcd.api.Event.getDefaultInstance();
}
@java.lang.Override
public com.ibm.etcd.api.Event build() {
com.ibm.etcd.api.Event result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.ibm.etcd.api.Event buildPartial() {
com.ibm.etcd.api.Event result = new com.ibm.etcd.api.Event(this);
result.type_ = type_;
if (kvBuilder_ == null) {
result.kv_ = kv_;
} else {
result.kv_ = kvBuilder_.build();
}
if (prevKvBuilder_ == null) {
result.prevKv_ = prevKv_;
} else {
result.prevKv_ = prevKvBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.ibm.etcd.api.Event) {
return mergeFrom((com.ibm.etcd.api.Event)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.ibm.etcd.api.Event other) {
if (other == com.ibm.etcd.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.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.ibm.etcd.api.Event parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.ibm.etcd.api.Event) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
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;
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 com.ibm.etcd.api.Event.EventType getType() {
@SuppressWarnings("deprecation")
com.ibm.etcd.api.Event.EventType result = com.ibm.etcd.api.Event.EventType.valueOf(type_);
return result == null ? com.ibm.etcd.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(com.ibm.etcd.api.Event.EventType value) {
if (value == null) {
throw new NullPointerException();
}
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() {
type_ = 0;
onChanged();
return this;
}
private com.ibm.etcd.api.KeyValue kv_;
private com.google.protobuf.SingleFieldBuilderV3<
com.ibm.etcd.api.KeyValue, com.ibm.etcd.api.KeyValue.Builder, com.ibm.etcd.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 kvBuilder_ != null || kv_ != null;
}
/**
*
* 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 com.ibm.etcd.api.KeyValue getKv() {
if (kvBuilder_ == null) {
return kv_ == null ? com.ibm.etcd.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(com.ibm.etcd.api.KeyValue value) {
if (kvBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
kv_ = value;
onChanged();
} else {
kvBuilder_.setMessage(value);
}
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(
com.ibm.etcd.api.KeyValue.Builder builderForValue) {
if (kvBuilder_ == null) {
kv_ = builderForValue.build();
onChanged();
} else {
kvBuilder_.setMessage(builderForValue.build());
}
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(com.ibm.etcd.api.KeyValue value) {
if (kvBuilder_ == null) {
if (kv_ != null) {
kv_ =
com.ibm.etcd.api.KeyValue.newBuilder(kv_).mergeFrom(value).buildPartial();
} else {
kv_ = value;
}
onChanged();
} else {
kvBuilder_.mergeFrom(value);
}
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() {
if (kvBuilder_ == null) {
kv_ = null;
onChanged();
} else {
kv_ = null;
kvBuilder_ = null;
}
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 com.ibm.etcd.api.KeyValue.Builder getKvBuilder() {
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 com.ibm.etcd.api.KeyValueOrBuilder getKvOrBuilder() {
if (kvBuilder_ != null) {
return kvBuilder_.getMessageOrBuilder();
} else {
return kv_ == null ?
com.ibm.etcd.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<
com.ibm.etcd.api.KeyValue, com.ibm.etcd.api.KeyValue.Builder, com.ibm.etcd.api.KeyValueOrBuilder>
getKvFieldBuilder() {
if (kvBuilder_ == null) {
kvBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.ibm.etcd.api.KeyValue, com.ibm.etcd.api.KeyValue.Builder, com.ibm.etcd.api.KeyValueOrBuilder>(
getKv(),
getParentForChildren(),
isClean());
kv_ = null;
}
return kvBuilder_;
}
private com.ibm.etcd.api.KeyValue prevKv_;
private com.google.protobuf.SingleFieldBuilderV3<
com.ibm.etcd.api.KeyValue, com.ibm.etcd.api.KeyValue.Builder, com.ibm.etcd.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 prevKvBuilder_ != null || prevKv_ != null;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
* @return The prevKv.
*/
public com.ibm.etcd.api.KeyValue getPrevKv() {
if (prevKvBuilder_ == null) {
return prevKv_ == null ? com.ibm.etcd.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(com.ibm.etcd.api.KeyValue value) {
if (prevKvBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
prevKv_ = value;
onChanged();
} else {
prevKvBuilder_.setMessage(value);
}
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public Builder setPrevKv(
com.ibm.etcd.api.KeyValue.Builder builderForValue) {
if (prevKvBuilder_ == null) {
prevKv_ = builderForValue.build();
onChanged();
} else {
prevKvBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public Builder mergePrevKv(com.ibm.etcd.api.KeyValue value) {
if (prevKvBuilder_ == null) {
if (prevKv_ != null) {
prevKv_ =
com.ibm.etcd.api.KeyValue.newBuilder(prevKv_).mergeFrom(value).buildPartial();
} else {
prevKv_ = value;
}
onChanged();
} else {
prevKvBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public Builder clearPrevKv() {
if (prevKvBuilder_ == null) {
prevKv_ = null;
onChanged();
} else {
prevKv_ = null;
prevKvBuilder_ = null;
}
return this;
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public com.ibm.etcd.api.KeyValue.Builder getPrevKvBuilder() {
onChanged();
return getPrevKvFieldBuilder().getBuilder();
}
/**
*
* prev_kv holds the key-value pair before the event happens.
*
*
* .mvccpb.KeyValue prev_kv = 3;
*/
public com.ibm.etcd.api.KeyValueOrBuilder getPrevKvOrBuilder() {
if (prevKvBuilder_ != null) {
return prevKvBuilder_.getMessageOrBuilder();
} else {
return prevKv_ == null ?
com.ibm.etcd.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<
com.ibm.etcd.api.KeyValue, com.ibm.etcd.api.KeyValue.Builder, com.ibm.etcd.api.KeyValueOrBuilder>
getPrevKvFieldBuilder() {
if (prevKvBuilder_ == null) {
prevKvBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.ibm.etcd.api.KeyValue, com.ibm.etcd.api.KeyValue.Builder, com.ibm.etcd.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 com.ibm.etcd.api.Event DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.ibm.etcd.api.Event();
}
public static com.ibm.etcd.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 {
return new Event(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.ibm.etcd.api.Event getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}