com.ibm.etcd.api.Compare Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of etcd-java Show documentation
Show all versions of etcd-java Show documentation
etcd3 java client and utilities
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: rpc.proto
package com.ibm.etcd.api;
/**
* Protobuf type {@code etcdserverpb.Compare}
*/
public final class Compare extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:etcdserverpb.Compare)
CompareOrBuilder {
private static final long serialVersionUID = 0L;
// Use Compare.newBuilder() to construct.
private Compare(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Compare() {
result_ = 0;
target_ = 0;
key_ = com.google.protobuf.ByteString.EMPTY;
rangeEnd_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Compare();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Compare(
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();
result_ = rawValue;
break;
}
case 16: {
int rawValue = input.readEnum();
target_ = rawValue;
break;
}
case 26: {
key_ = input.readBytes();
break;
}
case 32: {
targetUnionCase_ = 4;
targetUnion_ = input.readInt64();
break;
}
case 40: {
targetUnionCase_ = 5;
targetUnion_ = input.readInt64();
break;
}
case 48: {
targetUnionCase_ = 6;
targetUnion_ = input.readInt64();
break;
}
case 58: {
targetUnionCase_ = 7;
targetUnion_ = input.readBytes();
break;
}
case 64: {
targetUnionCase_ = 8;
targetUnion_ = input.readInt64();
break;
}
case 514: {
rangeEnd_ = input.readBytes();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
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.Rpc.internal_static_etcdserverpb_Compare_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_Compare_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.Compare.class, com.ibm.etcd.api.Compare.Builder.class);
}
/**
* Protobuf enum {@code etcdserverpb.Compare.CompareResult}
*/
public enum CompareResult
implements com.google.protobuf.ProtocolMessageEnum {
/**
* EQUAL = 0;
*/
EQUAL(0),
/**
* GREATER = 1;
*/
GREATER(1),
/**
* LESS = 2;
*/
LESS(2),
/**
* NOT_EQUAL = 3;
*/
NOT_EQUAL(3),
UNRECOGNIZED(-1),
;
/**
* EQUAL = 0;
*/
public static final int EQUAL_VALUE = 0;
/**
* GREATER = 1;
*/
public static final int GREATER_VALUE = 1;
/**
* LESS = 2;
*/
public static final int LESS_VALUE = 2;
/**
* NOT_EQUAL = 3;
*/
public static final int NOT_EQUAL_VALUE = 3;
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 CompareResult 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 CompareResult forNumber(int value) {
switch (value) {
case 0: return EQUAL;
case 1: return GREATER;
case 2: return LESS;
case 3: return NOT_EQUAL;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
CompareResult> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public CompareResult findValueByNumber(int number) {
return CompareResult.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.Compare.getDescriptor().getEnumTypes().get(0);
}
private static final CompareResult[] VALUES = values();
public static CompareResult 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 CompareResult(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:etcdserverpb.Compare.CompareResult)
}
/**
* Protobuf enum {@code etcdserverpb.Compare.CompareTarget}
*/
public enum CompareTarget
implements com.google.protobuf.ProtocolMessageEnum {
/**
* VERSION = 0;
*/
VERSION(0),
/**
* CREATE = 1;
*/
CREATE(1),
/**
* MOD = 2;
*/
MOD(2),
/**
* VALUE = 3;
*/
VALUE(3),
/**
* LEASE = 4;
*/
LEASE(4),
UNRECOGNIZED(-1),
;
/**
* VERSION = 0;
*/
public static final int VERSION_VALUE = 0;
/**
* CREATE = 1;
*/
public static final int CREATE_VALUE = 1;
/**
* MOD = 2;
*/
public static final int MOD_VALUE = 2;
/**
* VALUE = 3;
*/
public static final int VALUE_VALUE = 3;
/**
* LEASE = 4;
*/
public static final int LEASE_VALUE = 4;
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 CompareTarget 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 CompareTarget forNumber(int value) {
switch (value) {
case 0: return VERSION;
case 1: return CREATE;
case 2: return MOD;
case 3: return VALUE;
case 4: return LEASE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
CompareTarget> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public CompareTarget findValueByNumber(int number) {
return CompareTarget.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.Compare.getDescriptor().getEnumTypes().get(1);
}
private static final CompareTarget[] VALUES = values();
public static CompareTarget 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 CompareTarget(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:etcdserverpb.Compare.CompareTarget)
}
private int targetUnionCase_ = 0;
private java.lang.Object targetUnion_;
public enum TargetUnionCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
VERSION(4),
CREATE_REVISION(5),
MOD_REVISION(6),
VALUE(7),
LEASE(8),
TARGETUNION_NOT_SET(0);
private final int value;
private TargetUnionCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static TargetUnionCase valueOf(int value) {
return forNumber(value);
}
public static TargetUnionCase forNumber(int value) {
switch (value) {
case 4: return VERSION;
case 5: return CREATE_REVISION;
case 6: return MOD_REVISION;
case 7: return VALUE;
case 8: return LEASE;
case 0: return TARGETUNION_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public TargetUnionCase
getTargetUnionCase() {
return TargetUnionCase.forNumber(
targetUnionCase_);
}
public static final int RESULT_FIELD_NUMBER = 1;
private int result_;
/**
*
* result is logical comparison operation for this comparison.
*
*
* .etcdserverpb.Compare.CompareResult result = 1;
* @return The enum numeric value on the wire for result.
*/
@java.lang.Override public int getResultValue() {
return result_;
}
/**
*
* result is logical comparison operation for this comparison.
*
*
* .etcdserverpb.Compare.CompareResult result = 1;
* @return The result.
*/
@java.lang.Override public com.ibm.etcd.api.Compare.CompareResult getResult() {
@SuppressWarnings("deprecation")
com.ibm.etcd.api.Compare.CompareResult result = com.ibm.etcd.api.Compare.CompareResult.valueOf(result_);
return result == null ? com.ibm.etcd.api.Compare.CompareResult.UNRECOGNIZED : result;
}
public static final int TARGET_FIELD_NUMBER = 2;
private int target_;
/**
*
* target is the key-value field to inspect for the comparison.
*
*
* .etcdserverpb.Compare.CompareTarget target = 2;
* @return The enum numeric value on the wire for target.
*/
@java.lang.Override public int getTargetValue() {
return target_;
}
/**
*
* target is the key-value field to inspect for the comparison.
*
*
* .etcdserverpb.Compare.CompareTarget target = 2;
* @return The target.
*/
@java.lang.Override public com.ibm.etcd.api.Compare.CompareTarget getTarget() {
@SuppressWarnings("deprecation")
com.ibm.etcd.api.Compare.CompareTarget result = com.ibm.etcd.api.Compare.CompareTarget.valueOf(target_);
return result == null ? com.ibm.etcd.api.Compare.CompareTarget.UNRECOGNIZED : result;
}
public static final int KEY_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString key_;
/**
*
* key is the subject key for the comparison operation.
*
*
* bytes key = 3;
* @return The key.
*/
@java.lang.Override
public com.google.protobuf.ByteString getKey() {
return key_;
}
public static final int VERSION_FIELD_NUMBER = 4;
/**
*
* version is the version of the given key
*
*
* int64 version = 4;
* @return The version.
*/
@java.lang.Override
public long getVersion() {
if (targetUnionCase_ == 4) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
public static final int CREATE_REVISION_FIELD_NUMBER = 5;
/**
*
* create_revision is the creation revision of the given key
*
*
* int64 create_revision = 5;
* @return The createRevision.
*/
@java.lang.Override
public long getCreateRevision() {
if (targetUnionCase_ == 5) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
public static final int MOD_REVISION_FIELD_NUMBER = 6;
/**
*
* mod_revision is the last modified revision of the given key.
*
*
* int64 mod_revision = 6;
* @return The modRevision.
*/
@java.lang.Override
public long getModRevision() {
if (targetUnionCase_ == 6) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
public static final int VALUE_FIELD_NUMBER = 7;
/**
*
* value is the value of the given key, in bytes.
*
*
* bytes value = 7;
* @return The value.
*/
@java.lang.Override
public com.google.protobuf.ByteString getValue() {
if (targetUnionCase_ == 7) {
return (com.google.protobuf.ByteString) targetUnion_;
}
return com.google.protobuf.ByteString.EMPTY;
}
public static final int LEASE_FIELD_NUMBER = 8;
/**
*
* lease is the lease id of the given key.
*
*
* int64 lease = 8;
* @return The lease.
*/
@java.lang.Override
public long getLease() {
if (targetUnionCase_ == 8) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
public static final int RANGE_END_FIELD_NUMBER = 64;
private com.google.protobuf.ByteString rangeEnd_;
/**
*
* range_end compares the given target to all keys in the range [key, range_end).
* See RangeRequest for more details on key ranges.
*
*
* bytes range_end = 64;
* @return The rangeEnd.
*/
@java.lang.Override
public com.google.protobuf.ByteString getRangeEnd() {
return rangeEnd_;
}
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 (result_ != com.ibm.etcd.api.Compare.CompareResult.EQUAL.getNumber()) {
output.writeEnum(1, result_);
}
if (target_ != com.ibm.etcd.api.Compare.CompareTarget.VERSION.getNumber()) {
output.writeEnum(2, target_);
}
if (!key_.isEmpty()) {
output.writeBytes(3, key_);
}
if (targetUnionCase_ == 4) {
output.writeInt64(
4, (long)((java.lang.Long) targetUnion_));
}
if (targetUnionCase_ == 5) {
output.writeInt64(
5, (long)((java.lang.Long) targetUnion_));
}
if (targetUnionCase_ == 6) {
output.writeInt64(
6, (long)((java.lang.Long) targetUnion_));
}
if (targetUnionCase_ == 7) {
output.writeBytes(
7, (com.google.protobuf.ByteString) targetUnion_);
}
if (targetUnionCase_ == 8) {
output.writeInt64(
8, (long)((java.lang.Long) targetUnion_));
}
if (!rangeEnd_.isEmpty()) {
output.writeBytes(64, rangeEnd_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (result_ != com.ibm.etcd.api.Compare.CompareResult.EQUAL.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, result_);
}
if (target_ != com.ibm.etcd.api.Compare.CompareTarget.VERSION.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, target_);
}
if (!key_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, key_);
}
if (targetUnionCase_ == 4) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(
4, (long)((java.lang.Long) targetUnion_));
}
if (targetUnionCase_ == 5) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(
5, (long)((java.lang.Long) targetUnion_));
}
if (targetUnionCase_ == 6) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(
6, (long)((java.lang.Long) targetUnion_));
}
if (targetUnionCase_ == 7) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(
7, (com.google.protobuf.ByteString) targetUnion_);
}
if (targetUnionCase_ == 8) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(
8, (long)((java.lang.Long) targetUnion_));
}
if (!rangeEnd_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(64, rangeEnd_);
}
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.Compare)) {
return super.equals(obj);
}
com.ibm.etcd.api.Compare other = (com.ibm.etcd.api.Compare) obj;
if (result_ != other.result_) return false;
if (target_ != other.target_) return false;
if (!getKey()
.equals(other.getKey())) return false;
if (!getRangeEnd()
.equals(other.getRangeEnd())) return false;
if (!getTargetUnionCase().equals(other.getTargetUnionCase())) return false;
switch (targetUnionCase_) {
case 4:
if (getVersion()
!= other.getVersion()) return false;
break;
case 5:
if (getCreateRevision()
!= other.getCreateRevision()) return false;
break;
case 6:
if (getModRevision()
!= other.getModRevision()) return false;
break;
case 7:
if (!getValue()
.equals(other.getValue())) return false;
break;
case 8:
if (getLease()
!= other.getLease()) return false;
break;
case 0:
default:
}
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) + RESULT_FIELD_NUMBER;
hash = (53 * hash) + result_;
hash = (37 * hash) + TARGET_FIELD_NUMBER;
hash = (53 * hash) + target_;
hash = (37 * hash) + KEY_FIELD_NUMBER;
hash = (53 * hash) + getKey().hashCode();
hash = (37 * hash) + RANGE_END_FIELD_NUMBER;
hash = (53 * hash) + getRangeEnd().hashCode();
switch (targetUnionCase_) {
case 4:
hash = (37 * hash) + VERSION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getVersion());
break;
case 5:
hash = (37 * hash) + CREATE_REVISION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getCreateRevision());
break;
case 6:
hash = (37 * hash) + MOD_REVISION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getModRevision());
break;
case 7:
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + getValue().hashCode();
break;
case 8:
hash = (37 * hash) + LEASE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getLease());
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.ibm.etcd.api.Compare parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.Compare 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.Compare parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.Compare 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.Compare parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ibm.etcd.api.Compare parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ibm.etcd.api.Compare parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.Compare 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.Compare parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.Compare 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.Compare parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.ibm.etcd.api.Compare 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.Compare 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.Compare}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:etcdserverpb.Compare)
com.ibm.etcd.api.CompareOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_Compare_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_Compare_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ibm.etcd.api.Compare.class, com.ibm.etcd.api.Compare.Builder.class);
}
// Construct using com.ibm.etcd.api.Compare.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();
result_ = 0;
target_ = 0;
key_ = com.google.protobuf.ByteString.EMPTY;
rangeEnd_ = com.google.protobuf.ByteString.EMPTY;
targetUnionCase_ = 0;
targetUnion_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.ibm.etcd.api.Rpc.internal_static_etcdserverpb_Compare_descriptor;
}
@java.lang.Override
public com.ibm.etcd.api.Compare getDefaultInstanceForType() {
return com.ibm.etcd.api.Compare.getDefaultInstance();
}
@java.lang.Override
public com.ibm.etcd.api.Compare build() {
com.ibm.etcd.api.Compare result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.ibm.etcd.api.Compare buildPartial() {
com.ibm.etcd.api.Compare result = new com.ibm.etcd.api.Compare(this);
result.result_ = result_;
result.target_ = target_;
result.key_ = key_;
if (targetUnionCase_ == 4) {
result.targetUnion_ = targetUnion_;
}
if (targetUnionCase_ == 5) {
result.targetUnion_ = targetUnion_;
}
if (targetUnionCase_ == 6) {
result.targetUnion_ = targetUnion_;
}
if (targetUnionCase_ == 7) {
result.targetUnion_ = targetUnion_;
}
if (targetUnionCase_ == 8) {
result.targetUnion_ = targetUnion_;
}
result.rangeEnd_ = rangeEnd_;
result.targetUnionCase_ = targetUnionCase_;
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.Compare) {
return mergeFrom((com.ibm.etcd.api.Compare)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.ibm.etcd.api.Compare other) {
if (other == com.ibm.etcd.api.Compare.getDefaultInstance()) return this;
if (other.result_ != 0) {
setResultValue(other.getResultValue());
}
if (other.target_ != 0) {
setTargetValue(other.getTargetValue());
}
if (other.getKey() != com.google.protobuf.ByteString.EMPTY) {
setKey(other.getKey());
}
if (other.getRangeEnd() != com.google.protobuf.ByteString.EMPTY) {
setRangeEnd(other.getRangeEnd());
}
switch (other.getTargetUnionCase()) {
case VERSION: {
setVersion(other.getVersion());
break;
}
case CREATE_REVISION: {
setCreateRevision(other.getCreateRevision());
break;
}
case MOD_REVISION: {
setModRevision(other.getModRevision());
break;
}
case VALUE: {
setValue(other.getValue());
break;
}
case LEASE: {
setLease(other.getLease());
break;
}
case TARGETUNION_NOT_SET: {
break;
}
}
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.Compare parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.ibm.etcd.api.Compare) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int targetUnionCase_ = 0;
private java.lang.Object targetUnion_;
public TargetUnionCase
getTargetUnionCase() {
return TargetUnionCase.forNumber(
targetUnionCase_);
}
public Builder clearTargetUnion() {
targetUnionCase_ = 0;
targetUnion_ = null;
onChanged();
return this;
}
private int result_ = 0;
/**
*
* result is logical comparison operation for this comparison.
*
*
* .etcdserverpb.Compare.CompareResult result = 1;
* @return The enum numeric value on the wire for result.
*/
@java.lang.Override public int getResultValue() {
return result_;
}
/**
*
* result is logical comparison operation for this comparison.
*
*
* .etcdserverpb.Compare.CompareResult result = 1;
* @param value The enum numeric value on the wire for result to set.
* @return This builder for chaining.
*/
public Builder setResultValue(int value) {
result_ = value;
onChanged();
return this;
}
/**
*
* result is logical comparison operation for this comparison.
*
*
* .etcdserverpb.Compare.CompareResult result = 1;
* @return The result.
*/
@java.lang.Override
public com.ibm.etcd.api.Compare.CompareResult getResult() {
@SuppressWarnings("deprecation")
com.ibm.etcd.api.Compare.CompareResult result = com.ibm.etcd.api.Compare.CompareResult.valueOf(result_);
return result == null ? com.ibm.etcd.api.Compare.CompareResult.UNRECOGNIZED : result;
}
/**
*
* result is logical comparison operation for this comparison.
*
*
* .etcdserverpb.Compare.CompareResult result = 1;
* @param value The result to set.
* @return This builder for chaining.
*/
public Builder setResult(com.ibm.etcd.api.Compare.CompareResult value) {
if (value == null) {
throw new NullPointerException();
}
result_ = value.getNumber();
onChanged();
return this;
}
/**
*
* result is logical comparison operation for this comparison.
*
*
* .etcdserverpb.Compare.CompareResult result = 1;
* @return This builder for chaining.
*/
public Builder clearResult() {
result_ = 0;
onChanged();
return this;
}
private int target_ = 0;
/**
*
* target is the key-value field to inspect for the comparison.
*
*
* .etcdserverpb.Compare.CompareTarget target = 2;
* @return The enum numeric value on the wire for target.
*/
@java.lang.Override public int getTargetValue() {
return target_;
}
/**
*
* target is the key-value field to inspect for the comparison.
*
*
* .etcdserverpb.Compare.CompareTarget target = 2;
* @param value The enum numeric value on the wire for target to set.
* @return This builder for chaining.
*/
public Builder setTargetValue(int value) {
target_ = value;
onChanged();
return this;
}
/**
*
* target is the key-value field to inspect for the comparison.
*
*
* .etcdserverpb.Compare.CompareTarget target = 2;
* @return The target.
*/
@java.lang.Override
public com.ibm.etcd.api.Compare.CompareTarget getTarget() {
@SuppressWarnings("deprecation")
com.ibm.etcd.api.Compare.CompareTarget result = com.ibm.etcd.api.Compare.CompareTarget.valueOf(target_);
return result == null ? com.ibm.etcd.api.Compare.CompareTarget.UNRECOGNIZED : result;
}
/**
*
* target is the key-value field to inspect for the comparison.
*
*
* .etcdserverpb.Compare.CompareTarget target = 2;
* @param value The target to set.
* @return This builder for chaining.
*/
public Builder setTarget(com.ibm.etcd.api.Compare.CompareTarget value) {
if (value == null) {
throw new NullPointerException();
}
target_ = value.getNumber();
onChanged();
return this;
}
/**
*
* target is the key-value field to inspect for the comparison.
*
*
* .etcdserverpb.Compare.CompareTarget target = 2;
* @return This builder for chaining.
*/
public Builder clearTarget() {
target_ = 0;
onChanged();
return this;
}
private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* key is the subject key for the comparison operation.
*
*
* bytes key = 3;
* @return The key.
*/
@java.lang.Override
public com.google.protobuf.ByteString getKey() {
return key_;
}
/**
*
* key is the subject key for the comparison operation.
*
*
* bytes key = 3;
* @param value The key to set.
* @return This builder for chaining.
*/
public Builder setKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
key_ = value;
onChanged();
return this;
}
/**
*
* key is the subject key for the comparison operation.
*
*
* bytes key = 3;
* @return This builder for chaining.
*/
public Builder clearKey() {
key_ = getDefaultInstance().getKey();
onChanged();
return this;
}
/**
*
* version is the version of the given key
*
*
* int64 version = 4;
* @return The version.
*/
public long getVersion() {
if (targetUnionCase_ == 4) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
/**
*
* version is the version of the given key
*
*
* int64 version = 4;
* @param value The version to set.
* @return This builder for chaining.
*/
public Builder setVersion(long value) {
targetUnionCase_ = 4;
targetUnion_ = value;
onChanged();
return this;
}
/**
*
* version is the version of the given key
*
*
* int64 version = 4;
* @return This builder for chaining.
*/
public Builder clearVersion() {
if (targetUnionCase_ == 4) {
targetUnionCase_ = 0;
targetUnion_ = null;
onChanged();
}
return this;
}
/**
*
* create_revision is the creation revision of the given key
*
*
* int64 create_revision = 5;
* @return The createRevision.
*/
public long getCreateRevision() {
if (targetUnionCase_ == 5) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
/**
*
* create_revision is the creation revision of the given key
*
*
* int64 create_revision = 5;
* @param value The createRevision to set.
* @return This builder for chaining.
*/
public Builder setCreateRevision(long value) {
targetUnionCase_ = 5;
targetUnion_ = value;
onChanged();
return this;
}
/**
*
* create_revision is the creation revision of the given key
*
*
* int64 create_revision = 5;
* @return This builder for chaining.
*/
public Builder clearCreateRevision() {
if (targetUnionCase_ == 5) {
targetUnionCase_ = 0;
targetUnion_ = null;
onChanged();
}
return this;
}
/**
*
* mod_revision is the last modified revision of the given key.
*
*
* int64 mod_revision = 6;
* @return The modRevision.
*/
public long getModRevision() {
if (targetUnionCase_ == 6) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
/**
*
* mod_revision is the last modified revision of the given key.
*
*
* int64 mod_revision = 6;
* @param value The modRevision to set.
* @return This builder for chaining.
*/
public Builder setModRevision(long value) {
targetUnionCase_ = 6;
targetUnion_ = value;
onChanged();
return this;
}
/**
*
* mod_revision is the last modified revision of the given key.
*
*
* int64 mod_revision = 6;
* @return This builder for chaining.
*/
public Builder clearModRevision() {
if (targetUnionCase_ == 6) {
targetUnionCase_ = 0;
targetUnion_ = null;
onChanged();
}
return this;
}
/**
*
* value is the value of the given key, in bytes.
*
*
* bytes value = 7;
* @return The value.
*/
public com.google.protobuf.ByteString getValue() {
if (targetUnionCase_ == 7) {
return (com.google.protobuf.ByteString) targetUnion_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
* value is the value of the given key, in bytes.
*
*
* bytes value = 7;
* @param value The value to set.
* @return This builder for chaining.
*/
public Builder setValue(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
targetUnionCase_ = 7;
targetUnion_ = value;
onChanged();
return this;
}
/**
*
* value is the value of the given key, in bytes.
*
*
* bytes value = 7;
* @return This builder for chaining.
*/
public Builder clearValue() {
if (targetUnionCase_ == 7) {
targetUnionCase_ = 0;
targetUnion_ = null;
onChanged();
}
return this;
}
/**
*
* lease is the lease id of the given key.
*
*
* int64 lease = 8;
* @return The lease.
*/
public long getLease() {
if (targetUnionCase_ == 8) {
return (java.lang.Long) targetUnion_;
}
return 0L;
}
/**
*
* lease is the lease id of the given key.
*
*
* int64 lease = 8;
* @param value The lease to set.
* @return This builder for chaining.
*/
public Builder setLease(long value) {
targetUnionCase_ = 8;
targetUnion_ = value;
onChanged();
return this;
}
/**
*
* lease is the lease id of the given key.
*
*
* int64 lease = 8;
* @return This builder for chaining.
*/
public Builder clearLease() {
if (targetUnionCase_ == 8) {
targetUnionCase_ = 0;
targetUnion_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.ByteString rangeEnd_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* range_end compares the given target to all keys in the range [key, range_end).
* See RangeRequest for more details on key ranges.
*
*
* bytes range_end = 64;
* @return The rangeEnd.
*/
@java.lang.Override
public com.google.protobuf.ByteString getRangeEnd() {
return rangeEnd_;
}
/**
*
* range_end compares the given target to all keys in the range [key, range_end).
* See RangeRequest for more details on key ranges.
*
*
* bytes range_end = 64;
* @param value The rangeEnd to set.
* @return This builder for chaining.
*/
public Builder setRangeEnd(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
rangeEnd_ = value;
onChanged();
return this;
}
/**
*
* range_end compares the given target to all keys in the range [key, range_end).
* See RangeRequest for more details on key ranges.
*
*
* bytes range_end = 64;
* @return This builder for chaining.
*/
public Builder clearRangeEnd() {
rangeEnd_ = getDefaultInstance().getRangeEnd();
onChanged();
return this;
}
@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.Compare)
}
// @@protoc_insertion_point(class_scope:etcdserverpb.Compare)
private static final com.ibm.etcd.api.Compare DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.ibm.etcd.api.Compare();
}
public static com.ibm.etcd.api.Compare getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Compare parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Compare(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.Compare getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}