com.yandex.ydb.coordination.SemaphoreDescription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
JDBC client implementation over Table client, single jar
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ydb/public/api/protos/ydb_coordination.proto
package com.yandex.ydb.coordination;
/**
*
**
* Describes the state of a semaphore
*
*
* Protobuf type {@code Ydb.Coordination.SemaphoreDescription}
*/
public final class SemaphoreDescription extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:Ydb.Coordination.SemaphoreDescription)
SemaphoreDescriptionOrBuilder {
private static final long serialVersionUID = 0L;
// Use SemaphoreDescription.newBuilder() to construct.
private SemaphoreDescription(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private SemaphoreDescription() {
name_ = "";
data_ = com.google.protobuf.ByteString.EMPTY;
owners_ = java.util.Collections.emptyList();
waiters_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new SemaphoreDescription();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SemaphoreDescription(
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;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
data_ = input.readBytes();
break;
}
case 24: {
limit_ = input.readUInt64();
break;
}
case 32: {
ephemeral_ = input.readBool();
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
owners_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
owners_.add(
input.readMessage(com.yandex.ydb.coordination.SemaphoreSession.parser(), extensionRegistry));
break;
}
case 50: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
waiters_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
waiters_.add(
input.readMessage(com.yandex.ydb.coordination.SemaphoreSession.parser(), extensionRegistry));
break;
}
case 56: {
count_ = input.readUInt64();
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 {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
owners_ = java.util.Collections.unmodifiableList(owners_);
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
waiters_ = java.util.Collections.unmodifiableList(waiters_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreDescription_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreDescription_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yandex.ydb.coordination.SemaphoreDescription.class, com.yandex.ydb.coordination.SemaphoreDescription.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
* Name of the semaphore
*
*
* string name = 1;
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
* Name of the semaphore
*
*
* string name = 1;
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DATA_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString data_;
/**
*
* User-defined data attached to the semaphore
*
*
* bytes data = 2;
* @return The data.
*/
@java.lang.Override
public com.google.protobuf.ByteString getData() {
return data_;
}
public static final int COUNT_FIELD_NUMBER = 7;
private long count_;
/**
*
* Number of tokens currently acquired by owners
*
*
* uint64 count = 7;
* @return The count.
*/
@java.lang.Override
public long getCount() {
return count_;
}
public static final int LIMIT_FIELD_NUMBER = 3;
private long limit_;
/**
*
* Maximum number of tokens that may acquired
*
*
* uint64 limit = 3;
* @return The limit.
*/
@java.lang.Override
public long getLimit() {
return limit_;
}
public static final int EPHEMERAL_FIELD_NUMBER = 4;
private boolean ephemeral_;
/**
*
* Ephemeral semaphores are deleted when released by all owners and waiters
*
*
* bool ephemeral = 4;
* @return The ephemeral.
*/
@java.lang.Override
public boolean getEphemeral() {
return ephemeral_;
}
public static final int OWNERS_FIELD_NUMBER = 5;
private java.util.List owners_;
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
@java.lang.Override
public java.util.List getOwnersList() {
return owners_;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
@java.lang.Override
public java.util.List
getOwnersOrBuilderList() {
return owners_;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
@java.lang.Override
public int getOwnersCount() {
return owners_.size();
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSession getOwners(int index) {
return owners_.get(index);
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSessionOrBuilder getOwnersOrBuilder(
int index) {
return owners_.get(index);
}
public static final int WAITERS_FIELD_NUMBER = 6;
private java.util.List waiters_;
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
@java.lang.Override
public java.util.List getWaitersList() {
return waiters_;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
@java.lang.Override
public java.util.List
getWaitersOrBuilderList() {
return waiters_;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
@java.lang.Override
public int getWaitersCount() {
return waiters_.size();
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSession getWaiters(int index) {
return waiters_.get(index);
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreSessionOrBuilder getWaitersOrBuilder(
int index) {
return waiters_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (!data_.isEmpty()) {
output.writeBytes(2, data_);
}
if (limit_ != 0L) {
output.writeUInt64(3, limit_);
}
if (ephemeral_ != false) {
output.writeBool(4, ephemeral_);
}
for (int i = 0; i < owners_.size(); i++) {
output.writeMessage(5, owners_.get(i));
}
for (int i = 0; i < waiters_.size(); i++) {
output.writeMessage(6, waiters_.get(i));
}
if (count_ != 0L) {
output.writeUInt64(7, count_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (!data_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, data_);
}
if (limit_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(3, limit_);
}
if (ephemeral_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(4, ephemeral_);
}
for (int i = 0; i < owners_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, owners_.get(i));
}
for (int i = 0; i < waiters_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, waiters_.get(i));
}
if (count_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(7, count_);
}
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.yandex.ydb.coordination.SemaphoreDescription)) {
return super.equals(obj);
}
com.yandex.ydb.coordination.SemaphoreDescription other = (com.yandex.ydb.coordination.SemaphoreDescription) obj;
if (!getName()
.equals(other.getName())) return false;
if (!getData()
.equals(other.getData())) return false;
if (getCount()
!= other.getCount()) return false;
if (getLimit()
!= other.getLimit()) return false;
if (getEphemeral()
!= other.getEphemeral()) return false;
if (!getOwnersList()
.equals(other.getOwnersList())) return false;
if (!getWaitersList()
.equals(other.getWaitersList())) 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) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + DATA_FIELD_NUMBER;
hash = (53 * hash) + getData().hashCode();
hash = (37 * hash) + COUNT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getCount());
hash = (37 * hash) + LIMIT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getLimit());
hash = (37 * hash) + EPHEMERAL_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getEphemeral());
if (getOwnersCount() > 0) {
hash = (37 * hash) + OWNERS_FIELD_NUMBER;
hash = (53 * hash) + getOwnersList().hashCode();
}
if (getWaitersCount() > 0) {
hash = (37 * hash) + WAITERS_FIELD_NUMBER;
hash = (53 * hash) + getWaitersList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.yandex.ydb.coordination.SemaphoreDescription parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yandex.ydb.coordination.SemaphoreDescription parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreDescription parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yandex.ydb.coordination.SemaphoreDescription parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreDescription parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yandex.ydb.coordination.SemaphoreDescription parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yandex.ydb.coordination.SemaphoreDescription parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yandex.ydb.coordination.SemaphoreDescription 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.yandex.ydb.coordination.SemaphoreDescription parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.yandex.ydb.coordination.SemaphoreDescription 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.yandex.ydb.coordination.SemaphoreDescription parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yandex.ydb.coordination.SemaphoreDescription 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.yandex.ydb.coordination.SemaphoreDescription 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;
}
/**
*
**
* Describes the state of a semaphore
*
*
* Protobuf type {@code Ydb.Coordination.SemaphoreDescription}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:Ydb.Coordination.SemaphoreDescription)
com.yandex.ydb.coordination.SemaphoreDescriptionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreDescription_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreDescription_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yandex.ydb.coordination.SemaphoreDescription.class, com.yandex.ydb.coordination.SemaphoreDescription.Builder.class);
}
// Construct using com.yandex.ydb.coordination.SemaphoreDescription.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getOwnersFieldBuilder();
getWaitersFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
data_ = com.google.protobuf.ByteString.EMPTY;
count_ = 0L;
limit_ = 0L;
ephemeral_ = false;
if (ownersBuilder_ == null) {
owners_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ownersBuilder_.clear();
}
if (waitersBuilder_ == null) {
waiters_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
waitersBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.yandex.ydb.coordination.CoordinationProtos.internal_static_Ydb_Coordination_SemaphoreDescription_descriptor;
}
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreDescription getDefaultInstanceForType() {
return com.yandex.ydb.coordination.SemaphoreDescription.getDefaultInstance();
}
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreDescription build() {
com.yandex.ydb.coordination.SemaphoreDescription result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.yandex.ydb.coordination.SemaphoreDescription buildPartial() {
com.yandex.ydb.coordination.SemaphoreDescription result = new com.yandex.ydb.coordination.SemaphoreDescription(this);
int from_bitField0_ = bitField0_;
result.name_ = name_;
result.data_ = data_;
result.count_ = count_;
result.limit_ = limit_;
result.ephemeral_ = ephemeral_;
if (ownersBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
owners_ = java.util.Collections.unmodifiableList(owners_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.owners_ = owners_;
} else {
result.owners_ = ownersBuilder_.build();
}
if (waitersBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
waiters_ = java.util.Collections.unmodifiableList(waiters_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.waiters_ = waiters_;
} else {
result.waiters_ = waitersBuilder_.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.yandex.ydb.coordination.SemaphoreDescription) {
return mergeFrom((com.yandex.ydb.coordination.SemaphoreDescription)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.yandex.ydb.coordination.SemaphoreDescription other) {
if (other == com.yandex.ydb.coordination.SemaphoreDescription.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.getData() != com.google.protobuf.ByteString.EMPTY) {
setData(other.getData());
}
if (other.getCount() != 0L) {
setCount(other.getCount());
}
if (other.getLimit() != 0L) {
setLimit(other.getLimit());
}
if (other.getEphemeral() != false) {
setEphemeral(other.getEphemeral());
}
if (ownersBuilder_ == null) {
if (!other.owners_.isEmpty()) {
if (owners_.isEmpty()) {
owners_ = other.owners_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureOwnersIsMutable();
owners_.addAll(other.owners_);
}
onChanged();
}
} else {
if (!other.owners_.isEmpty()) {
if (ownersBuilder_.isEmpty()) {
ownersBuilder_.dispose();
ownersBuilder_ = null;
owners_ = other.owners_;
bitField0_ = (bitField0_ & ~0x00000001);
ownersBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getOwnersFieldBuilder() : null;
} else {
ownersBuilder_.addAllMessages(other.owners_);
}
}
}
if (waitersBuilder_ == null) {
if (!other.waiters_.isEmpty()) {
if (waiters_.isEmpty()) {
waiters_ = other.waiters_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureWaitersIsMutable();
waiters_.addAll(other.waiters_);
}
onChanged();
}
} else {
if (!other.waiters_.isEmpty()) {
if (waitersBuilder_.isEmpty()) {
waitersBuilder_.dispose();
waitersBuilder_ = null;
waiters_ = other.waiters_;
bitField0_ = (bitField0_ & ~0x00000002);
waitersBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getWaitersFieldBuilder() : null;
} else {
waitersBuilder_.addAllMessages(other.waiters_);
}
}
}
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.yandex.ydb.coordination.SemaphoreDescription parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.yandex.ydb.coordination.SemaphoreDescription) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
* Name of the semaphore
*
*
* string name = 1;
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Name of the semaphore
*
*
* string name = 1;
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Name of the semaphore
*
*
* string name = 1;
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* Name of the semaphore
*
*
* string name = 1;
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* Name of the semaphore
*
*
* string name = 1;
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* User-defined data attached to the semaphore
*
*
* bytes data = 2;
* @return The data.
*/
@java.lang.Override
public com.google.protobuf.ByteString getData() {
return data_;
}
/**
*
* User-defined data attached to the semaphore
*
*
* bytes data = 2;
* @param value The data to set.
* @return This builder for chaining.
*/
public Builder setData(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
onChanged();
return this;
}
/**
*
* User-defined data attached to the semaphore
*
*
* bytes data = 2;
* @return This builder for chaining.
*/
public Builder clearData() {
data_ = getDefaultInstance().getData();
onChanged();
return this;
}
private long count_ ;
/**
*
* Number of tokens currently acquired by owners
*
*
* uint64 count = 7;
* @return The count.
*/
@java.lang.Override
public long getCount() {
return count_;
}
/**
*
* Number of tokens currently acquired by owners
*
*
* uint64 count = 7;
* @param value The count to set.
* @return This builder for chaining.
*/
public Builder setCount(long value) {
count_ = value;
onChanged();
return this;
}
/**
*
* Number of tokens currently acquired by owners
*
*
* uint64 count = 7;
* @return This builder for chaining.
*/
public Builder clearCount() {
count_ = 0L;
onChanged();
return this;
}
private long limit_ ;
/**
*
* Maximum number of tokens that may acquired
*
*
* uint64 limit = 3;
* @return The limit.
*/
@java.lang.Override
public long getLimit() {
return limit_;
}
/**
*
* Maximum number of tokens that may acquired
*
*
* uint64 limit = 3;
* @param value The limit to set.
* @return This builder for chaining.
*/
public Builder setLimit(long value) {
limit_ = value;
onChanged();
return this;
}
/**
*
* Maximum number of tokens that may acquired
*
*
* uint64 limit = 3;
* @return This builder for chaining.
*/
public Builder clearLimit() {
limit_ = 0L;
onChanged();
return this;
}
private boolean ephemeral_ ;
/**
*
* Ephemeral semaphores are deleted when released by all owners and waiters
*
*
* bool ephemeral = 4;
* @return The ephemeral.
*/
@java.lang.Override
public boolean getEphemeral() {
return ephemeral_;
}
/**
*
* Ephemeral semaphores are deleted when released by all owners and waiters
*
*
* bool ephemeral = 4;
* @param value The ephemeral to set.
* @return This builder for chaining.
*/
public Builder setEphemeral(boolean value) {
ephemeral_ = value;
onChanged();
return this;
}
/**
*
* Ephemeral semaphores are deleted when released by all owners and waiters
*
*
* bool ephemeral = 4;
* @return This builder for chaining.
*/
public Builder clearEphemeral() {
ephemeral_ = false;
onChanged();
return this;
}
private java.util.List owners_ =
java.util.Collections.emptyList();
private void ensureOwnersIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
owners_ = new java.util.ArrayList(owners_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.yandex.ydb.coordination.SemaphoreSession, com.yandex.ydb.coordination.SemaphoreSession.Builder, com.yandex.ydb.coordination.SemaphoreSessionOrBuilder> ownersBuilder_;
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public java.util.List getOwnersList() {
if (ownersBuilder_ == null) {
return java.util.Collections.unmodifiableList(owners_);
} else {
return ownersBuilder_.getMessageList();
}
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public int getOwnersCount() {
if (ownersBuilder_ == null) {
return owners_.size();
} else {
return ownersBuilder_.getCount();
}
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public com.yandex.ydb.coordination.SemaphoreSession getOwners(int index) {
if (ownersBuilder_ == null) {
return owners_.get(index);
} else {
return ownersBuilder_.getMessage(index);
}
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder setOwners(
int index, com.yandex.ydb.coordination.SemaphoreSession value) {
if (ownersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOwnersIsMutable();
owners_.set(index, value);
onChanged();
} else {
ownersBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder setOwners(
int index, com.yandex.ydb.coordination.SemaphoreSession.Builder builderForValue) {
if (ownersBuilder_ == null) {
ensureOwnersIsMutable();
owners_.set(index, builderForValue.build());
onChanged();
} else {
ownersBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder addOwners(com.yandex.ydb.coordination.SemaphoreSession value) {
if (ownersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOwnersIsMutable();
owners_.add(value);
onChanged();
} else {
ownersBuilder_.addMessage(value);
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder addOwners(
int index, com.yandex.ydb.coordination.SemaphoreSession value) {
if (ownersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOwnersIsMutable();
owners_.add(index, value);
onChanged();
} else {
ownersBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder addOwners(
com.yandex.ydb.coordination.SemaphoreSession.Builder builderForValue) {
if (ownersBuilder_ == null) {
ensureOwnersIsMutable();
owners_.add(builderForValue.build());
onChanged();
} else {
ownersBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder addOwners(
int index, com.yandex.ydb.coordination.SemaphoreSession.Builder builderForValue) {
if (ownersBuilder_ == null) {
ensureOwnersIsMutable();
owners_.add(index, builderForValue.build());
onChanged();
} else {
ownersBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder addAllOwners(
java.lang.Iterable values) {
if (ownersBuilder_ == null) {
ensureOwnersIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, owners_);
onChanged();
} else {
ownersBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder clearOwners() {
if (ownersBuilder_ == null) {
owners_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
ownersBuilder_.clear();
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public Builder removeOwners(int index) {
if (ownersBuilder_ == null) {
ensureOwnersIsMutable();
owners_.remove(index);
onChanged();
} else {
ownersBuilder_.remove(index);
}
return this;
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public com.yandex.ydb.coordination.SemaphoreSession.Builder getOwnersBuilder(
int index) {
return getOwnersFieldBuilder().getBuilder(index);
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public com.yandex.ydb.coordination.SemaphoreSessionOrBuilder getOwnersOrBuilder(
int index) {
if (ownersBuilder_ == null) {
return owners_.get(index); } else {
return ownersBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public java.util.List
getOwnersOrBuilderList() {
if (ownersBuilder_ != null) {
return ownersBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(owners_);
}
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public com.yandex.ydb.coordination.SemaphoreSession.Builder addOwnersBuilder() {
return getOwnersFieldBuilder().addBuilder(
com.yandex.ydb.coordination.SemaphoreSession.getDefaultInstance());
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public com.yandex.ydb.coordination.SemaphoreSession.Builder addOwnersBuilder(
int index) {
return getOwnersFieldBuilder().addBuilder(
index, com.yandex.ydb.coordination.SemaphoreSession.getDefaultInstance());
}
/**
*
* A list of current owners of the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession owners = 5;
*/
public java.util.List
getOwnersBuilderList() {
return getOwnersFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.yandex.ydb.coordination.SemaphoreSession, com.yandex.ydb.coordination.SemaphoreSession.Builder, com.yandex.ydb.coordination.SemaphoreSessionOrBuilder>
getOwnersFieldBuilder() {
if (ownersBuilder_ == null) {
ownersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.yandex.ydb.coordination.SemaphoreSession, com.yandex.ydb.coordination.SemaphoreSession.Builder, com.yandex.ydb.coordination.SemaphoreSessionOrBuilder>(
owners_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
owners_ = null;
}
return ownersBuilder_;
}
private java.util.List waiters_ =
java.util.Collections.emptyList();
private void ensureWaitersIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
waiters_ = new java.util.ArrayList(waiters_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.yandex.ydb.coordination.SemaphoreSession, com.yandex.ydb.coordination.SemaphoreSession.Builder, com.yandex.ydb.coordination.SemaphoreSessionOrBuilder> waitersBuilder_;
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public java.util.List getWaitersList() {
if (waitersBuilder_ == null) {
return java.util.Collections.unmodifiableList(waiters_);
} else {
return waitersBuilder_.getMessageList();
}
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public int getWaitersCount() {
if (waitersBuilder_ == null) {
return waiters_.size();
} else {
return waitersBuilder_.getCount();
}
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public com.yandex.ydb.coordination.SemaphoreSession getWaiters(int index) {
if (waitersBuilder_ == null) {
return waiters_.get(index);
} else {
return waitersBuilder_.getMessage(index);
}
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder setWaiters(
int index, com.yandex.ydb.coordination.SemaphoreSession value) {
if (waitersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureWaitersIsMutable();
waiters_.set(index, value);
onChanged();
} else {
waitersBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder setWaiters(
int index, com.yandex.ydb.coordination.SemaphoreSession.Builder builderForValue) {
if (waitersBuilder_ == null) {
ensureWaitersIsMutable();
waiters_.set(index, builderForValue.build());
onChanged();
} else {
waitersBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder addWaiters(com.yandex.ydb.coordination.SemaphoreSession value) {
if (waitersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureWaitersIsMutable();
waiters_.add(value);
onChanged();
} else {
waitersBuilder_.addMessage(value);
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder addWaiters(
int index, com.yandex.ydb.coordination.SemaphoreSession value) {
if (waitersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureWaitersIsMutable();
waiters_.add(index, value);
onChanged();
} else {
waitersBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder addWaiters(
com.yandex.ydb.coordination.SemaphoreSession.Builder builderForValue) {
if (waitersBuilder_ == null) {
ensureWaitersIsMutable();
waiters_.add(builderForValue.build());
onChanged();
} else {
waitersBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder addWaiters(
int index, com.yandex.ydb.coordination.SemaphoreSession.Builder builderForValue) {
if (waitersBuilder_ == null) {
ensureWaitersIsMutable();
waiters_.add(index, builderForValue.build());
onChanged();
} else {
waitersBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder addAllWaiters(
java.lang.Iterable values) {
if (waitersBuilder_ == null) {
ensureWaitersIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, waiters_);
onChanged();
} else {
waitersBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder clearWaiters() {
if (waitersBuilder_ == null) {
waiters_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
waitersBuilder_.clear();
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public Builder removeWaiters(int index) {
if (waitersBuilder_ == null) {
ensureWaitersIsMutable();
waiters_.remove(index);
onChanged();
} else {
waitersBuilder_.remove(index);
}
return this;
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public com.yandex.ydb.coordination.SemaphoreSession.Builder getWaitersBuilder(
int index) {
return getWaitersFieldBuilder().getBuilder(index);
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public com.yandex.ydb.coordination.SemaphoreSessionOrBuilder getWaitersOrBuilder(
int index) {
if (waitersBuilder_ == null) {
return waiters_.get(index); } else {
return waitersBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public java.util.List
getWaitersOrBuilderList() {
if (waitersBuilder_ != null) {
return waitersBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(waiters_);
}
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public com.yandex.ydb.coordination.SemaphoreSession.Builder addWaitersBuilder() {
return getWaitersFieldBuilder().addBuilder(
com.yandex.ydb.coordination.SemaphoreSession.getDefaultInstance());
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public com.yandex.ydb.coordination.SemaphoreSession.Builder addWaitersBuilder(
int index) {
return getWaitersFieldBuilder().addBuilder(
index, com.yandex.ydb.coordination.SemaphoreSession.getDefaultInstance());
}
/**
*
* A list of current waiters on the semaphore
*
*
* repeated .Ydb.Coordination.SemaphoreSession waiters = 6;
*/
public java.util.List
getWaitersBuilderList() {
return getWaitersFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.yandex.ydb.coordination.SemaphoreSession, com.yandex.ydb.coordination.SemaphoreSession.Builder, com.yandex.ydb.coordination.SemaphoreSessionOrBuilder>
getWaitersFieldBuilder() {
if (waitersBuilder_ == null) {
waitersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.yandex.ydb.coordination.SemaphoreSession, com.yandex.ydb.coordination.SemaphoreSession.Builder, com.yandex.ydb.coordination.SemaphoreSessionOrBuilder>(
waiters_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
waiters_ = null;
}
return waitersBuilder_;
}
@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:Ydb.Coordination.SemaphoreDescription)
}
// @@protoc_insertion_point(class_scope:Ydb.Coordination.SemaphoreDescription)
private static final com.yandex.ydb.coordination.SemaphoreDescription DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.yandex.ydb.coordination.SemaphoreDescription();
}
public static com.yandex.ydb.coordination.SemaphoreDescription getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public SemaphoreDescription parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SemaphoreDescription(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.yandex.ydb.coordination.SemaphoreDescription getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}