com.ibm.etcd.api.KeyValue 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.KeyValue}
*/
public final class KeyValue extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:mvccpb.KeyValue)
KeyValueOrBuilder {
private static final long serialVersionUID = 0L;
// Use KeyValue.newBuilder() to construct.
private KeyValue(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private KeyValue() {
key_ = com.google.protobuf.ByteString.EMPTY;
createRevision_ = 0L;
modRevision_ = 0L;
version_ = 0L;
value_ = com.google.protobuf.ByteString.EMPTY;
lease_ = 0L;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private KeyValue(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
key_ = input.readBytes();
break;
}
case 16: {
createRevision_ = input.readInt64();
break;
}
case 24: {
modRevision_ = input.readInt64();
break;
}
case 32: {
version_ = input.readInt64();
break;
}
case 42: {
value_ = input.readBytes();
break;
}
case 48: {
lease_ = input.readInt64();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_KeyValue_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_KeyValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.KeyValue.class, com.ibm.etcd.api.KeyValue.Builder.class);
}
public static final int KEY_FIELD_NUMBER = 1;
private com.google.protobuf.ByteString key_;
/**
*
* key is the key in bytes. An empty key is not allowed.
*
*
* bytes key = 1;
*/
public com.google.protobuf.ByteString getKey() {
return key_;
}
public static final int CREATE_REVISION_FIELD_NUMBER = 2;
private long createRevision_;
/**
*
* create_revision is the revision of last creation on this key.
*
*
* int64 create_revision = 2;
*/
public long getCreateRevision() {
return createRevision_;
}
public static final int MOD_REVISION_FIELD_NUMBER = 3;
private long modRevision_;
/**
*
* mod_revision is the revision of last modification on this key.
*
*
* int64 mod_revision = 3;
*/
public long getModRevision() {
return modRevision_;
}
public static final int VERSION_FIELD_NUMBER = 4;
private long version_;
/**
*
* version is the version of the key. A deletion resets
* the version to zero and any modification of the key
* increases its version.
*
*
* int64 version = 4;
*/
public long getVersion() {
return version_;
}
public static final int VALUE_FIELD_NUMBER = 5;
private com.google.protobuf.ByteString value_;
/**
*
* value is the value held by the key, in bytes.
*
*
* bytes value = 5;
*/
public com.google.protobuf.ByteString getValue() {
return value_;
}
public static final int LEASE_FIELD_NUMBER = 6;
private long lease_;
/**
*
* lease is the ID of the lease that attached to key.
* When the attached lease expires, the key will be deleted.
* If lease is 0, then no lease is attached to the key.
*
*
* int64 lease = 6;
*/
public long getLease() {
return lease_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!key_.isEmpty()) {
output.writeBytes(1, key_);
}
if (createRevision_ != 0L) {
output.writeInt64(2, createRevision_);
}
if (modRevision_ != 0L) {
output.writeInt64(3, modRevision_);
}
if (version_ != 0L) {
output.writeInt64(4, version_);
}
if (!value_.isEmpty()) {
output.writeBytes(5, value_);
}
if (lease_ != 0L) {
output.writeInt64(6, lease_);
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!key_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, key_);
}
if (createRevision_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, createRevision_);
}
if (modRevision_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(3, modRevision_);
}
if (version_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(4, version_);
}
if (!value_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, value_);
}
if (lease_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(6, lease_);
}
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.KeyValue)) {
return super.equals(obj);
}
com.ibm.etcd.api.KeyValue other = (com.ibm.etcd.api.KeyValue) obj;
boolean result = true;
result = result && getKey()
.equals(other.getKey());
result = result && (getCreateRevision()
== other.getCreateRevision());
result = result && (getModRevision()
== other.getModRevision());
result = result && (getVersion()
== other.getVersion());
result = result && getValue()
.equals(other.getValue());
result = result && (getLease()
== other.getLease());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + KEY_FIELD_NUMBER;
hash = (53 * hash) + getKey().hashCode();
hash = (37 * hash) + CREATE_REVISION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getCreateRevision());
hash = (37 * hash) + MOD_REVISION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getModRevision());
hash = (37 * hash) + VERSION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getVersion());
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + getValue().hashCode();
hash = (37 * hash) + LEASE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getLease());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.ibm.etcd.api.KeyValue parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.KeyValue 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.KeyValue parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.KeyValue 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.KeyValue parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.KeyValue parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ibm.etcd.api.KeyValue parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.KeyValue 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.KeyValue parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.KeyValue 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.KeyValue parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.KeyValue parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.ibm.etcd.api.KeyValue prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mvccpb.KeyValue}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:mvccpb.KeyValue)
com.ibm.etcd.api.KeyValueOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_KeyValue_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_KeyValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.KeyValue.class, com.ibm.etcd.api.KeyValue.Builder.class);
}
// Construct using com.ibm.etcd.api.KeyValue.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
key_ = com.google.protobuf.ByteString.EMPTY;
createRevision_ = 0L;
modRevision_ = 0L;
version_ = 0L;
value_ = com.google.protobuf.ByteString.EMPTY;
lease_ = 0L;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.ibm.etcd.api.Kv.internal_static_mvccpb_KeyValue_descriptor;
}
public com.ibm.etcd.api.KeyValue getDefaultInstanceForType() {
return com.ibm.etcd.api.KeyValue.getDefaultInstance();
}
public com.ibm.etcd.api.KeyValue build() {
com.ibm.etcd.api.KeyValue result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.ibm.etcd.api.KeyValue buildPartial() {
com.ibm.etcd.api.KeyValue result = new com.ibm.etcd.api.KeyValue(this);
result.key_ = key_;
result.createRevision_ = createRevision_;
result.modRevision_ = modRevision_;
result.version_ = version_;
result.value_ = value_;
result.lease_ = lease_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.ibm.etcd.api.KeyValue) {
return mergeFrom((com.ibm.etcd.api.KeyValue)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.ibm.etcd.api.KeyValue other) {
if (other == com.ibm.etcd.api.KeyValue.getDefaultInstance()) return this;
if (other.getKey() != com.google.protobuf.ByteString.EMPTY) {
setKey(other.getKey());
}
if (other.getCreateRevision() != 0L) {
setCreateRevision(other.getCreateRevision());
}
if (other.getModRevision() != 0L) {
setModRevision(other.getModRevision());
}
if (other.getVersion() != 0L) {
setVersion(other.getVersion());
}
if (other.getValue() != com.google.protobuf.ByteString.EMPTY) {
setValue(other.getValue());
}
if (other.getLease() != 0L) {
setLease(other.getLease());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.ibm.etcd.api.KeyValue parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.ibm.etcd.api.KeyValue) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* key is the key in bytes. An empty key is not allowed.
*
*
* bytes key = 1;
*/
public com.google.protobuf.ByteString getKey() {
return key_;
}
/**
*
* key is the key in bytes. An empty key is not allowed.
*
*
* bytes key = 1;
*/
public Builder setKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
key_ = value;
onChanged();
return this;
}
/**
*
* key is the key in bytes. An empty key is not allowed.
*
*
* bytes key = 1;
*/
public Builder clearKey() {
key_ = getDefaultInstance().getKey();
onChanged();
return this;
}
private long createRevision_ ;
/**
*
* create_revision is the revision of last creation on this key.
*
*
* int64 create_revision = 2;
*/
public long getCreateRevision() {
return createRevision_;
}
/**
*
* create_revision is the revision of last creation on this key.
*
*
* int64 create_revision = 2;
*/
public Builder setCreateRevision(long value) {
createRevision_ = value;
onChanged();
return this;
}
/**
*
* create_revision is the revision of last creation on this key.
*
*
* int64 create_revision = 2;
*/
public Builder clearCreateRevision() {
createRevision_ = 0L;
onChanged();
return this;
}
private long modRevision_ ;
/**
*
* mod_revision is the revision of last modification on this key.
*
*
* int64 mod_revision = 3;
*/
public long getModRevision() {
return modRevision_;
}
/**
*
* mod_revision is the revision of last modification on this key.
*
*
* int64 mod_revision = 3;
*/
public Builder setModRevision(long value) {
modRevision_ = value;
onChanged();
return this;
}
/**
*
* mod_revision is the revision of last modification on this key.
*
*
* int64 mod_revision = 3;
*/
public Builder clearModRevision() {
modRevision_ = 0L;
onChanged();
return this;
}
private long version_ ;
/**
*
* version is the version of the key. A deletion resets
* the version to zero and any modification of the key
* increases its version.
*
*
* int64 version = 4;
*/
public long getVersion() {
return version_;
}
/**
*
* version is the version of the key. A deletion resets
* the version to zero and any modification of the key
* increases its version.
*
*
* int64 version = 4;
*/
public Builder setVersion(long value) {
version_ = value;
onChanged();
return this;
}
/**
*
* version is the version of the key. A deletion resets
* the version to zero and any modification of the key
* increases its version.
*
*
* int64 version = 4;
*/
public Builder clearVersion() {
version_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* value is the value held by the key, in bytes.
*
*
* bytes value = 5;
*/
public com.google.protobuf.ByteString getValue() {
return value_;
}
/**
*
* value is the value held by the key, in bytes.
*
*
* bytes value = 5;
*/
public Builder setValue(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
value_ = value;
onChanged();
return this;
}
/**
*
* value is the value held by the key, in bytes.
*
*
* bytes value = 5;
*/
public Builder clearValue() {
value_ = getDefaultInstance().getValue();
onChanged();
return this;
}
private long lease_ ;
/**
*
* lease is the ID of the lease that attached to key.
* When the attached lease expires, the key will be deleted.
* If lease is 0, then no lease is attached to the key.
*
*
* int64 lease = 6;
*/
public long getLease() {
return lease_;
}
/**
*
* lease is the ID of the lease that attached to key.
* When the attached lease expires, the key will be deleted.
* If lease is 0, then no lease is attached to the key.
*
*
* int64 lease = 6;
*/
public Builder setLease(long value) {
lease_ = value;
onChanged();
return this;
}
/**
*
* lease is the ID of the lease that attached to key.
* When the attached lease expires, the key will be deleted.
* If lease is 0, then no lease is attached to the key.
*
*
* int64 lease = 6;
*/
public Builder clearLease() {
lease_ = 0L;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:mvccpb.KeyValue)
}
// @@protoc_insertion_point(class_scope:mvccpb.KeyValue)
private static final com.ibm.etcd.api.KeyValue DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.ibm.etcd.api.KeyValue();
}
public static com.ibm.etcd.api.KeyValue getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public KeyValue parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new KeyValue(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.ibm.etcd.api.KeyValue getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}