io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: service_config.proto
// Protobuf Java Version: 3.25.4
package io.grpc.serviceconfig;
/**
*
* Configuration for priority LB policy.
*
*
* Protobuf type {@code grpc.service_config.PriorityLoadBalancingPolicyConfig}
*/
public final class PriorityLoadBalancingPolicyConfig extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.service_config.PriorityLoadBalancingPolicyConfig)
PriorityLoadBalancingPolicyConfigOrBuilder {
private static final long serialVersionUID = 0L;
// Use PriorityLoadBalancingPolicyConfig.newBuilder() to construct.
private PriorityLoadBalancingPolicyConfig(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private PriorityLoadBalancingPolicyConfig() {
priorities_ =
com.google.protobuf.LazyStringArrayList.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new PriorityLoadBalancingPolicyConfig();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 1:
return internalGetChildren();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.class, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Builder.class);
}
public interface ChildOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.service_config.PriorityLoadBalancingPolicyConfig.Child)
com.google.protobuf.MessageOrBuilder {
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
java.util.List
getConfigList();
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
io.grpc.serviceconfig.LoadBalancingConfig getConfig(int index);
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
int getConfigCount();
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
java.util.List extends io.grpc.serviceconfig.LoadBalancingConfigOrBuilder>
getConfigOrBuilderList();
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
io.grpc.serviceconfig.LoadBalancingConfigOrBuilder getConfigOrBuilder(
int index);
/**
*
* If true, will ignore reresolution requests from this child.
*
*
* bool ignore_reresolution_requests = 2;
* @return The ignoreReresolutionRequests.
*/
boolean getIgnoreReresolutionRequests();
}
/**
*
* A map of name to child policy configuration.
* The names are used to allow the priority policy to update
* existing child policies instead of creating new ones every
* time it receives a config update.
*
*
* Protobuf type {@code grpc.service_config.PriorityLoadBalancingPolicyConfig.Child}
*/
public static final class Child extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.service_config.PriorityLoadBalancingPolicyConfig.Child)
ChildOrBuilder {
private static final long serialVersionUID = 0L;
// Use Child.newBuilder() to construct.
private Child(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Child() {
config_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Child();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_Child_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_Child_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.class, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.Builder.class);
}
public static final int CONFIG_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private java.util.List config_;
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
@java.lang.Override
public java.util.List getConfigList() {
return config_;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
@java.lang.Override
public java.util.List extends io.grpc.serviceconfig.LoadBalancingConfigOrBuilder>
getConfigOrBuilderList() {
return config_;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
@java.lang.Override
public int getConfigCount() {
return config_.size();
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
@java.lang.Override
public io.grpc.serviceconfig.LoadBalancingConfig getConfig(int index) {
return config_.get(index);
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
@java.lang.Override
public io.grpc.serviceconfig.LoadBalancingConfigOrBuilder getConfigOrBuilder(
int index) {
return config_.get(index);
}
public static final int IGNORE_RERESOLUTION_REQUESTS_FIELD_NUMBER = 2;
private boolean ignoreReresolutionRequests_ = false;
/**
*
* If true, will ignore reresolution requests from this child.
*
*
* bool ignore_reresolution_requests = 2;
* @return The ignoreReresolutionRequests.
*/
@java.lang.Override
public boolean getIgnoreReresolutionRequests() {
return ignoreReresolutionRequests_;
}
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 {
for (int i = 0; i < config_.size(); i++) {
output.writeMessage(1, config_.get(i));
}
if (ignoreReresolutionRequests_ != false) {
output.writeBool(2, ignoreReresolutionRequests_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < config_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, config_.get(i));
}
if (ignoreReresolutionRequests_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(2, ignoreReresolutionRequests_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child)) {
return super.equals(obj);
}
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child other = (io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child) obj;
if (!getConfigList()
.equals(other.getConfigList())) return false;
if (getIgnoreReresolutionRequests()
!= other.getIgnoreReresolutionRequests()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getConfigCount() > 0) {
hash = (37 * hash) + CONFIG_FIELD_NUMBER;
hash = (53 * hash) + getConfigList().hashCode();
}
hash = (37 * hash) + IGNORE_RERESOLUTION_REQUESTS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIgnoreReresolutionRequests());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child 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;
}
/**
*
* A map of name to child policy configuration.
* The names are used to allow the priority policy to update
* existing child policies instead of creating new ones every
* time it receives a config update.
*
*
* Protobuf type {@code grpc.service_config.PriorityLoadBalancingPolicyConfig.Child}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:grpc.service_config.PriorityLoadBalancingPolicyConfig.Child)
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.ChildOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_Child_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_Child_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.class, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.Builder.class);
}
// Construct using io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (configBuilder_ == null) {
config_ = java.util.Collections.emptyList();
} else {
config_ = null;
configBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
ignoreReresolutionRequests_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_Child_descriptor;
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child getDefaultInstanceForType() {
return io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.getDefaultInstance();
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child build() {
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child buildPartial() {
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child result = new io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child result) {
if (configBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
config_ = java.util.Collections.unmodifiableList(config_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.config_ = config_;
} else {
result.config_ = configBuilder_.build();
}
}
private void buildPartial0(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.ignoreReresolutionRequests_ = ignoreReresolutionRequests_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child) {
return mergeFrom((io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child other) {
if (other == io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.getDefaultInstance()) return this;
if (configBuilder_ == null) {
if (!other.config_.isEmpty()) {
if (config_.isEmpty()) {
config_ = other.config_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureConfigIsMutable();
config_.addAll(other.config_);
}
onChanged();
}
} else {
if (!other.config_.isEmpty()) {
if (configBuilder_.isEmpty()) {
configBuilder_.dispose();
configBuilder_ = null;
config_ = other.config_;
bitField0_ = (bitField0_ & ~0x00000001);
configBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getConfigFieldBuilder() : null;
} else {
configBuilder_.addAllMessages(other.config_);
}
}
}
if (other.getIgnoreReresolutionRequests() != false) {
setIgnoreReresolutionRequests(other.getIgnoreReresolutionRequests());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
io.grpc.serviceconfig.LoadBalancingConfig m =
input.readMessage(
io.grpc.serviceconfig.LoadBalancingConfig.parser(),
extensionRegistry);
if (configBuilder_ == null) {
ensureConfigIsMutable();
config_.add(m);
} else {
configBuilder_.addMessage(m);
}
break;
} // case 10
case 16: {
ignoreReresolutionRequests_ = input.readBool();
bitField0_ |= 0x00000002;
break;
} // case 16
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.util.List config_ =
java.util.Collections.emptyList();
private void ensureConfigIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
config_ = new java.util.ArrayList(config_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.grpc.serviceconfig.LoadBalancingConfig, io.grpc.serviceconfig.LoadBalancingConfig.Builder, io.grpc.serviceconfig.LoadBalancingConfigOrBuilder> configBuilder_;
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public java.util.List getConfigList() {
if (configBuilder_ == null) {
return java.util.Collections.unmodifiableList(config_);
} else {
return configBuilder_.getMessageList();
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public int getConfigCount() {
if (configBuilder_ == null) {
return config_.size();
} else {
return configBuilder_.getCount();
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public io.grpc.serviceconfig.LoadBalancingConfig getConfig(int index) {
if (configBuilder_ == null) {
return config_.get(index);
} else {
return configBuilder_.getMessage(index);
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder setConfig(
int index, io.grpc.serviceconfig.LoadBalancingConfig value) {
if (configBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConfigIsMutable();
config_.set(index, value);
onChanged();
} else {
configBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder setConfig(
int index, io.grpc.serviceconfig.LoadBalancingConfig.Builder builderForValue) {
if (configBuilder_ == null) {
ensureConfigIsMutable();
config_.set(index, builderForValue.build());
onChanged();
} else {
configBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder addConfig(io.grpc.serviceconfig.LoadBalancingConfig value) {
if (configBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConfigIsMutable();
config_.add(value);
onChanged();
} else {
configBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder addConfig(
int index, io.grpc.serviceconfig.LoadBalancingConfig value) {
if (configBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConfigIsMutable();
config_.add(index, value);
onChanged();
} else {
configBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder addConfig(
io.grpc.serviceconfig.LoadBalancingConfig.Builder builderForValue) {
if (configBuilder_ == null) {
ensureConfigIsMutable();
config_.add(builderForValue.build());
onChanged();
} else {
configBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder addConfig(
int index, io.grpc.serviceconfig.LoadBalancingConfig.Builder builderForValue) {
if (configBuilder_ == null) {
ensureConfigIsMutable();
config_.add(index, builderForValue.build());
onChanged();
} else {
configBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder addAllConfig(
java.lang.Iterable extends io.grpc.serviceconfig.LoadBalancingConfig> values) {
if (configBuilder_ == null) {
ensureConfigIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, config_);
onChanged();
} else {
configBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder clearConfig() {
if (configBuilder_ == null) {
config_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
configBuilder_.clear();
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public Builder removeConfig(int index) {
if (configBuilder_ == null) {
ensureConfigIsMutable();
config_.remove(index);
onChanged();
} else {
configBuilder_.remove(index);
}
return this;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public io.grpc.serviceconfig.LoadBalancingConfig.Builder getConfigBuilder(
int index) {
return getConfigFieldBuilder().getBuilder(index);
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public io.grpc.serviceconfig.LoadBalancingConfigOrBuilder getConfigOrBuilder(
int index) {
if (configBuilder_ == null) {
return config_.get(index); } else {
return configBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public java.util.List extends io.grpc.serviceconfig.LoadBalancingConfigOrBuilder>
getConfigOrBuilderList() {
if (configBuilder_ != null) {
return configBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(config_);
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public io.grpc.serviceconfig.LoadBalancingConfig.Builder addConfigBuilder() {
return getConfigFieldBuilder().addBuilder(
io.grpc.serviceconfig.LoadBalancingConfig.getDefaultInstance());
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public io.grpc.serviceconfig.LoadBalancingConfig.Builder addConfigBuilder(
int index) {
return getConfigFieldBuilder().addBuilder(
index, io.grpc.serviceconfig.LoadBalancingConfig.getDefaultInstance());
}
/**
* repeated .grpc.service_config.LoadBalancingConfig config = 1;
*/
public java.util.List
getConfigBuilderList() {
return getConfigFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.grpc.serviceconfig.LoadBalancingConfig, io.grpc.serviceconfig.LoadBalancingConfig.Builder, io.grpc.serviceconfig.LoadBalancingConfigOrBuilder>
getConfigFieldBuilder() {
if (configBuilder_ == null) {
configBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.grpc.serviceconfig.LoadBalancingConfig, io.grpc.serviceconfig.LoadBalancingConfig.Builder, io.grpc.serviceconfig.LoadBalancingConfigOrBuilder>(
config_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
config_ = null;
}
return configBuilder_;
}
private boolean ignoreReresolutionRequests_ ;
/**
*
* If true, will ignore reresolution requests from this child.
*
*
* bool ignore_reresolution_requests = 2;
* @return The ignoreReresolutionRequests.
*/
@java.lang.Override
public boolean getIgnoreReresolutionRequests() {
return ignoreReresolutionRequests_;
}
/**
*
* If true, will ignore reresolution requests from this child.
*
*
* bool ignore_reresolution_requests = 2;
* @param value The ignoreReresolutionRequests to set.
* @return This builder for chaining.
*/
public Builder setIgnoreReresolutionRequests(boolean value) {
ignoreReresolutionRequests_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* If true, will ignore reresolution requests from this child.
*
*
* bool ignore_reresolution_requests = 2;
* @return This builder for chaining.
*/
public Builder clearIgnoreReresolutionRequests() {
bitField0_ = (bitField0_ & ~0x00000002);
ignoreReresolutionRequests_ = false;
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:grpc.service_config.PriorityLoadBalancingPolicyConfig.Child)
}
// @@protoc_insertion_point(class_scope:grpc.service_config.PriorityLoadBalancingPolicyConfig.Child)
private static final io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child();
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Child parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int CHILDREN_FIELD_NUMBER = 1;
private static final class ChildrenDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_ChildrenEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.getDefaultInstance());
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child> children_;
private com.google.protobuf.MapField
internalGetChildren() {
if (children_ == null) {
return com.google.protobuf.MapField.emptyMapField(
ChildrenDefaultEntryHolder.defaultEntry);
}
return children_;
}
public int getChildrenCount() {
return internalGetChildren().getMap().size();
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public boolean containsChildren(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetChildren().getMap().containsKey(key);
}
/**
* Use {@link #getChildrenMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getChildren() {
return getChildrenMap();
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public java.util.Map getChildrenMap() {
return internalGetChildren().getMap();
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public /* nullable */
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child getChildrenOrDefault(
java.lang.String key,
/* nullable */
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child defaultValue) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetChildren().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child getChildrenOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetChildren().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int PRIORITIES_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList priorities_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @return A list containing the priorities.
*/
public com.google.protobuf.ProtocolStringList
getPrioritiesList() {
return priorities_;
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @return The count of priorities.
*/
public int getPrioritiesCount() {
return priorities_.size();
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param index The index of the element to return.
* @return The priorities at the given index.
*/
public java.lang.String getPriorities(int index) {
return priorities_.get(index);
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param index The index of the value to return.
* @return The bytes of the priorities at the given index.
*/
public com.google.protobuf.ByteString
getPrioritiesBytes(int index) {
return priorities_.getByteString(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 {
com.google.protobuf.GeneratedMessageV3
.serializeStringMapTo(
output,
internalGetChildren(),
ChildrenDefaultEntryHolder.defaultEntry,
1);
for (int i = 0; i < priorities_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, priorities_.getRaw(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (java.util.Map.Entry entry
: internalGetChildren().getMap().entrySet()) {
com.google.protobuf.MapEntry
children__ = ChildrenDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, children__);
}
{
int dataSize = 0;
for (int i = 0; i < priorities_.size(); i++) {
dataSize += computeStringSizeNoTag(priorities_.getRaw(i));
}
size += dataSize;
size += 1 * getPrioritiesList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig)) {
return super.equals(obj);
}
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig other = (io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig) obj;
if (!internalGetChildren().equals(
other.internalGetChildren())) return false;
if (!getPrioritiesList()
.equals(other.getPrioritiesList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (!internalGetChildren().getMap().isEmpty()) {
hash = (37 * hash) + CHILDREN_FIELD_NUMBER;
hash = (53 * hash) + internalGetChildren().hashCode();
}
if (getPrioritiesCount() > 0) {
hash = (37 * hash) + PRIORITIES_FIELD_NUMBER;
hash = (53 * hash) + getPrioritiesList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig 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;
}
/**
*
* Configuration for priority LB policy.
*
*
* Protobuf type {@code grpc.service_config.PriorityLoadBalancingPolicyConfig}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:grpc.service_config.PriorityLoadBalancingPolicyConfig)
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfigOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 1:
return internalGetChildren();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 1:
return internalGetMutableChildren();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.class, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Builder.class);
}
// Construct using io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
internalGetMutableChildren().clear();
priorities_ =
com.google.protobuf.LazyStringArrayList.emptyList();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_PriorityLoadBalancingPolicyConfig_descriptor;
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig getDefaultInstanceForType() {
return io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.getDefaultInstance();
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig build() {
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig buildPartial() {
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig result = new io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.children_ = internalGetChildren().build(ChildrenDefaultEntryHolder.defaultEntry);
}
if (((from_bitField0_ & 0x00000002) != 0)) {
priorities_.makeImmutable();
result.priorities_ = priorities_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig) {
return mergeFrom((io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig other) {
if (other == io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.getDefaultInstance()) return this;
internalGetMutableChildren().mergeFrom(
other.internalGetChildren());
bitField0_ |= 0x00000001;
if (!other.priorities_.isEmpty()) {
if (priorities_.isEmpty()) {
priorities_ = other.priorities_;
bitField0_ |= 0x00000002;
} else {
ensurePrioritiesIsMutable();
priorities_.addAll(other.priorities_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
com.google.protobuf.MapEntry
children__ = input.readMessage(
ChildrenDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
internalGetMutableChildren().ensureBuilderMap().put(
children__.getKey(), children__.getValue());
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
java.lang.String s = input.readStringRequireUtf8();
ensurePrioritiesIsMutable();
priorities_.add(s);
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private static final class ChildrenConverter implements com.google.protobuf.MapFieldBuilder.Converter {
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child build(io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.ChildOrBuilder val) {
if (val instanceof io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child) { return (io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child) val; }
return ((io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.Builder) val).build();
}
@java.lang.Override
public com.google.protobuf.MapEntry defaultEntry() {
return ChildrenDefaultEntryHolder.defaultEntry;
}
};
private static final ChildrenConverter childrenConverter = new ChildrenConverter();
private com.google.protobuf.MapFieldBuilder<
java.lang.String, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.ChildOrBuilder, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child, io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.Builder> children_;
private com.google.protobuf.MapFieldBuilder
internalGetChildren() {
if (children_ == null) {
return new com.google.protobuf.MapFieldBuilder<>(childrenConverter);
}
return children_;
}
private com.google.protobuf.MapFieldBuilder
internalGetMutableChildren() {
if (children_ == null) {
children_ = new com.google.protobuf.MapFieldBuilder<>(childrenConverter);
}
bitField0_ |= 0x00000001;
onChanged();
return children_;
}
public int getChildrenCount() {
return internalGetChildren().ensureBuilderMap().size();
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public boolean containsChildren(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetChildren().ensureBuilderMap().containsKey(key);
}
/**
* Use {@link #getChildrenMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getChildren() {
return getChildrenMap();
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public java.util.Map getChildrenMap() {
return internalGetChildren().getImmutableMap();
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public /* nullable */
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child getChildrenOrDefault(
java.lang.String key,
/* nullable */
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child defaultValue) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map = internalGetMutableChildren().ensureBuilderMap();
return map.containsKey(key) ? childrenConverter.build(map.get(key)) : defaultValue;
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child getChildrenOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map = internalGetMutableChildren().ensureBuilderMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return childrenConverter.build(map.get(key));
}
public Builder clearChildren() {
bitField0_ = (bitField0_ & ~0x00000001);
internalGetMutableChildren().clear();
return this;
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
public Builder removeChildren(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
internalGetMutableChildren().ensureBuilderMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map
getMutableChildren() {
bitField0_ |= 0x00000001;
return internalGetMutableChildren().ensureMessageMap();
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
public Builder putChildren(
java.lang.String key,
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child value) {
if (key == null) { throw new NullPointerException("map key"); }
if (value == null) { throw new NullPointerException("map value"); }
internalGetMutableChildren().ensureBuilderMap()
.put(key, value);
bitField0_ |= 0x00000001;
return this;
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
public Builder putAllChildren(
java.util.Map values) {
for (java.util.Map.Entry e : values.entrySet()) {
if (e.getKey() == null || e.getValue() == null) {
throw new NullPointerException();
}
}
internalGetMutableChildren().ensureBuilderMap()
.putAll(values);
bitField0_ |= 0x00000001;
return this;
}
/**
* map<string, .grpc.service_config.PriorityLoadBalancingPolicyConfig.Child> children = 1;
*/
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.Builder putChildrenBuilderIfAbsent(
java.lang.String key) {
java.util.Map builderMap = internalGetMutableChildren().ensureBuilderMap();
io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.ChildOrBuilder entry = builderMap.get(key);
if (entry == null) {
entry = io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.newBuilder();
builderMap.put(key, entry);
}
if (entry instanceof io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child) {
entry = ((io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child) entry).toBuilder();
builderMap.put(key, entry);
}
return (io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig.Child.Builder) entry;
}
private com.google.protobuf.LazyStringArrayList priorities_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensurePrioritiesIsMutable() {
if (!priorities_.isModifiable()) {
priorities_ = new com.google.protobuf.LazyStringArrayList(priorities_);
}
bitField0_ |= 0x00000002;
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @return A list containing the priorities.
*/
public com.google.protobuf.ProtocolStringList
getPrioritiesList() {
priorities_.makeImmutable();
return priorities_;
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @return The count of priorities.
*/
public int getPrioritiesCount() {
return priorities_.size();
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param index The index of the element to return.
* @return The priorities at the given index.
*/
public java.lang.String getPriorities(int index) {
return priorities_.get(index);
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param index The index of the value to return.
* @return The bytes of the priorities at the given index.
*/
public com.google.protobuf.ByteString
getPrioritiesBytes(int index) {
return priorities_.getByteString(index);
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param index The index to set the value at.
* @param value The priorities to set.
* @return This builder for chaining.
*/
public Builder setPriorities(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensurePrioritiesIsMutable();
priorities_.set(index, value);
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param value The priorities to add.
* @return This builder for chaining.
*/
public Builder addPriorities(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensurePrioritiesIsMutable();
priorities_.add(value);
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param values The priorities to add.
* @return This builder for chaining.
*/
public Builder addAllPriorities(
java.lang.Iterable values) {
ensurePrioritiesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, priorities_);
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @return This builder for chaining.
*/
public Builder clearPriorities() {
priorities_ =
com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);;
onChanged();
return this;
}
/**
*
* A list of child names in decreasing priority order
* (i.e., first element is the highest priority).
*
*
* repeated string priorities = 2;
* @param value The bytes of the priorities to add.
* @return This builder for chaining.
*/
public Builder addPrioritiesBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
ensurePrioritiesIsMutable();
priorities_.add(value);
bitField0_ |= 0x00000002;
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:grpc.service_config.PriorityLoadBalancingPolicyConfig)
}
// @@protoc_insertion_point(class_scope:grpc.service_config.PriorityLoadBalancingPolicyConfig)
private static final io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig();
}
public static io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public PriorityLoadBalancingPolicyConfig parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.grpc.serviceconfig.PriorityLoadBalancingPolicyConfig getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy