Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!// source: service_config.proto// Protobuf Java Version: 3.25.4package io.grpc.serviceconfig;
/**
*
* Configuration for weighted_target LB policy.
*
*
* Protobuf type {@code grpc.service_config.WeightedTargetLoadBalancingPolicyConfig}
*/
public finalclassWeightedTargetLoadBalancingPolicyConfigextends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig)WeightedTargetLoadBalancingPolicyConfigOrBuilder {
private static final long serialVersionUID = 0L;
// Use WeightedTargetLoadBalancingPolicyConfig.newBuilder() to construct.privateWeightedTargetLoadBalancingPolicyConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
privateWeightedTargetLoadBalancingPolicyConfig() {
}
@java.lang.Override@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
returnnewWeightedTargetLoadBalancingPolicyConfig();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Overrideprotected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case1:
return internalGetTargets();
default:
thrownewRuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Overrideprotected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.class, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Builder.class);
}
public interface TargetOrBuilderextends// @@protoc_insertion_point(interface_extends:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target)
com.google.protobuf.MessageOrBuilder {
/**
* uint32 weight = 1;
* @return The weight.
*/
int getWeight();
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
java.util.List
getChildPolicyList();
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
io.grpc.serviceconfig.LoadBalancingConfig getChildPolicy(int index);
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
int getChildPolicyCount();
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
java.util.List
getChildPolicyOrBuilderList();
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
io.grpc.serviceconfig.LoadBalancingConfigOrBuilder getChildPolicyOrBuilder(
int index);
}
/**
* Protobuf type {@code grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target}
*/
public static finalclassTargetextends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target)TargetOrBuilder {
private static final long serialVersionUID = 0L;
// Use Target.newBuilder() to construct.privateTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
privateTarget() {
childPolicy_ = java.util.Collections.emptyList();
}
@java.lang.Override@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
returnnewTarget();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_Target_descriptor;
}
@java.lang.Overrideprotected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_Target_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.class, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.Builder.class);
}
public static final int WEIGHT_FIELD_NUMBER = 1;
private int weight_ = 0;
/**
* uint32 weight = 1;
* @return The weight.
*/@java.lang.Override
public int getWeight() {
return weight_;
}
public static final int CHILD_POLICY_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List childPolicy_;
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/@java.lang.Override
public java.util.List getChildPolicyList() {
return childPolicy_;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/@java.lang.Override
public java.util.List
getChildPolicyOrBuilderList() {
return childPolicy_;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/@java.lang.Override
public int getChildPolicyCount() {
return childPolicy_.size();
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/@java.lang.Override
public io.grpc.serviceconfig.LoadBalancingConfig getChildPolicy(int index) {
return childPolicy_.get(index);
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/@java.lang.Override
public io.grpc.serviceconfig.LoadBalancingConfigOrBuilder getChildPolicyOrBuilder(
int index) {
return childPolicy_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) returntrue;
if (isInitialized == 0) returnfalse;
memoizedIsInitialized = 1;
returntrue;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (weight_ != 0) {
output.writeUInt32(1, weight_);
}
for (int i = 0; i < childPolicy_.size(); i++) {
output.writeMessage(2, childPolicy_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (weight_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, weight_);
}
for (int i = 0; i < childPolicy_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, childPolicy_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
returntrue;
}
if (!(obj instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target)) {
returnsuper.equals(obj);
}
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target other = (io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target) obj;
if (getWeight()
!= other.getWeight()) returnfalse;
if (!getChildPolicyList()
.equals(other.getChildPolicyList())) returnfalse;
if (!getUnknownFields().equals(other.getUnknownFields())) returnfalse;
returntrue;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + WEIGHT_FIELD_NUMBER;
hash = (53 * hash) + getWeight();
if (getChildPolicyCount() > 0) {
hash = (37 * hash) + CHILD_POLICY_FIELD_NUMBER;
hash = (53 * hash) + getChildPolicyList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target 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.WeightedTargetLoadBalancingPolicyConfig.Target parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target 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.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target 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() {
returnDEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target prototype) {
returnDEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
returnthis == DEFAULT_INSTANCE
? newBuilder() : newBuilder().mergeFrom(this);
}
@java.lang.OverrideprotectedBuilder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = newBuilder(parent);
return builder;
}
/**
* Protobuf type {@code grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target}
*/
public static finalclassBuilderextends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target)
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.TargetOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_Target_descriptor;
}
@java.lang.Overrideprotected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_Target_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.class, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.Builder.class);
}
// Construct using io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.newBuilder()privateBuilder() {
}
privateBuilder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
weight_ = 0;
if (childPolicyBuilder_ == null) {
childPolicy_ = java.util.Collections.emptyList();
} else {
childPolicy_ = null;
childPolicyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
returnthis;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_Target_descriptor;
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getDefaultInstanceForType() {
return io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.getDefaultInstance();
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target build() {
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target buildPartial() {
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target result = new io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target result) {
if (childPolicyBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
childPolicy_ = java.util.Collections.unmodifiableList(childPolicy_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.childPolicy_ = childPolicy_;
} else {
result.childPolicy_ = childPolicyBuilder_.build();
}
}
private void buildPartial0(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.weight_ = weight_;
}
}
@java.lang.Override
public Builder clone() {
returnsuper.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
returnsuper.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
returnsuper.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
returnsuper.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
returnsuper.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
returnsuper.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target) {
return mergeFrom((io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target)other);
} else {
super.mergeFrom(other);
returnthis;
}
}
public Builder mergeFrom(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target other) {
if (other == io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.getDefaultInstance()) returnthis;
if (other.getWeight() != 0) {
setWeight(other.getWeight());
}
if (childPolicyBuilder_ == null) {
if (!other.childPolicy_.isEmpty()) {
if (childPolicy_.isEmpty()) {
childPolicy_ = other.childPolicy_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureChildPolicyIsMutable();
childPolicy_.addAll(other.childPolicy_);
}
onChanged();
}
} else {
if (!other.childPolicy_.isEmpty()) {
if (childPolicyBuilder_.isEmpty()) {
childPolicyBuilder_.dispose();
childPolicyBuilder_ = null;
childPolicy_ = other.childPolicy_;
bitField0_ = (bitField0_ & ~0x00000002);
childPolicyBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getChildPolicyFieldBuilder() : null;
} else {
childPolicyBuilder_.addAllMessages(other.childPolicy_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
returnthis;
}
@java.lang.Override
public final boolean isInitialized() {
returntrue;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
thrownew java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case0:
done = true;
break;
case8: {
weight_ = input.readUInt32();
bitField0_ |= 0x00000001;
break;
} // case 8case18: {
io.grpc.serviceconfig.LoadBalancingConfig m =
input.readMessage(
io.grpc.serviceconfig.LoadBalancingConfig.parser(),
extensionRegistry);
if (childPolicyBuilder_ == null) {
ensureChildPolicyIsMutable();
childPolicy_.add(m);
} else {
childPolicyBuilder_.addMessage(m);
}
break;
} // case 18default: {
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();
} // finallyreturnthis;
}
private int bitField0_;
private int weight_ ;
/**
* uint32 weight = 1;
* @return The weight.
*/@java.lang.Override
public int getWeight() {
return weight_;
}
/**
* uint32 weight = 1;
* @param value The weight to set.
* @return This builder for chaining.
*/
public Builder setWeight(int value) {
weight_ = value;
bitField0_ |= 0x00000001;
onChanged();
returnthis;
}
/**
* uint32 weight = 1;
* @return This builder for chaining.
*/
public Builder clearWeight() {
bitField0_ = (bitField0_ & ~0x00000001);
weight_ = 0;
onChanged();
returnthis;
}
private java.util.List childPolicy_ =
java.util.Collections.emptyList();
private void ensureChildPolicyIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
childPolicy_ = new java.util.ArrayList(childPolicy_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.grpc.serviceconfig.LoadBalancingConfig, io.grpc.serviceconfig.LoadBalancingConfig.Builder, io.grpc.serviceconfig.LoadBalancingConfigOrBuilder> childPolicyBuilder_;
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public java.util.List getChildPolicyList() {
if (childPolicyBuilder_ == null) {
return java.util.Collections.unmodifiableList(childPolicy_);
} else {
return childPolicyBuilder_.getMessageList();
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public int getChildPolicyCount() {
if (childPolicyBuilder_ == null) {
return childPolicy_.size();
} else {
return childPolicyBuilder_.getCount();
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public io.grpc.serviceconfig.LoadBalancingConfig getChildPolicy(int index) {
if (childPolicyBuilder_ == null) {
return childPolicy_.get(index);
} else {
return childPolicyBuilder_.getMessage(index);
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder setChildPolicy(
int index, io.grpc.serviceconfig.LoadBalancingConfig value) {
if (childPolicyBuilder_ == null) {
if (value == null) {
thrownewNullPointerException();
}
ensureChildPolicyIsMutable();
childPolicy_.set(index, value);
onChanged();
} else {
childPolicyBuilder_.setMessage(index, value);
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder setChildPolicy(
int index, io.grpc.serviceconfig.LoadBalancingConfig.Builder builderForValue) {
if (childPolicyBuilder_ == null) {
ensureChildPolicyIsMutable();
childPolicy_.set(index, builderForValue.build());
onChanged();
} else {
childPolicyBuilder_.setMessage(index, builderForValue.build());
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder addChildPolicy(io.grpc.serviceconfig.LoadBalancingConfig value) {
if (childPolicyBuilder_ == null) {
if (value == null) {
thrownewNullPointerException();
}
ensureChildPolicyIsMutable();
childPolicy_.add(value);
onChanged();
} else {
childPolicyBuilder_.addMessage(value);
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder addChildPolicy(
int index, io.grpc.serviceconfig.LoadBalancingConfig value) {
if (childPolicyBuilder_ == null) {
if (value == null) {
thrownewNullPointerException();
}
ensureChildPolicyIsMutable();
childPolicy_.add(index, value);
onChanged();
} else {
childPolicyBuilder_.addMessage(index, value);
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder addChildPolicy(
io.grpc.serviceconfig.LoadBalancingConfig.Builder builderForValue) {
if (childPolicyBuilder_ == null) {
ensureChildPolicyIsMutable();
childPolicy_.add(builderForValue.build());
onChanged();
} else {
childPolicyBuilder_.addMessage(builderForValue.build());
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder addChildPolicy(
int index, io.grpc.serviceconfig.LoadBalancingConfig.Builder builderForValue) {
if (childPolicyBuilder_ == null) {
ensureChildPolicyIsMutable();
childPolicy_.add(index, builderForValue.build());
onChanged();
} else {
childPolicyBuilder_.addMessage(index, builderForValue.build());
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder addAllChildPolicy(
java.lang.Iterable values) {
if (childPolicyBuilder_ == null) {
ensureChildPolicyIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, childPolicy_);
onChanged();
} else {
childPolicyBuilder_.addAllMessages(values);
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder clearChildPolicy() {
if (childPolicyBuilder_ == null) {
childPolicy_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
childPolicyBuilder_.clear();
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public Builder removeChildPolicy(int index) {
if (childPolicyBuilder_ == null) {
ensureChildPolicyIsMutable();
childPolicy_.remove(index);
onChanged();
} else {
childPolicyBuilder_.remove(index);
}
returnthis;
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public io.grpc.serviceconfig.LoadBalancingConfig.Builder getChildPolicyBuilder(
int index) {
return getChildPolicyFieldBuilder().getBuilder(index);
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public io.grpc.serviceconfig.LoadBalancingConfigOrBuilder getChildPolicyOrBuilder(
int index) {
if (childPolicyBuilder_ == null) {
return childPolicy_.get(index); } else {
return childPolicyBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public java.util.List
getChildPolicyOrBuilderList() {
if (childPolicyBuilder_ != null) {
return childPolicyBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(childPolicy_);
}
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public io.grpc.serviceconfig.LoadBalancingConfig.Builder addChildPolicyBuilder() {
return getChildPolicyFieldBuilder().addBuilder(
io.grpc.serviceconfig.LoadBalancingConfig.getDefaultInstance());
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public io.grpc.serviceconfig.LoadBalancingConfig.Builder addChildPolicyBuilder(
int index) {
return getChildPolicyFieldBuilder().addBuilder(
index, io.grpc.serviceconfig.LoadBalancingConfig.getDefaultInstance());
}
/**
* repeated .grpc.service_config.LoadBalancingConfig child_policy = 2;
*/
public java.util.List
getChildPolicyBuilderList() {
return getChildPolicyFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.grpc.serviceconfig.LoadBalancingConfig, io.grpc.serviceconfig.LoadBalancingConfig.Builder, io.grpc.serviceconfig.LoadBalancingConfigOrBuilder>
getChildPolicyFieldBuilder() {
if (childPolicyBuilder_ == null) {
childPolicyBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.grpc.serviceconfig.LoadBalancingConfig, io.grpc.serviceconfig.LoadBalancingConfig.Builder, io.grpc.serviceconfig.LoadBalancingConfigOrBuilder>(
childPolicy_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
childPolicy_ = null;
}
return childPolicyBuilder_;
}
@java.lang.Override
public finalBuilder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
returnsuper.setUnknownFields(unknownFields);
}
@java.lang.Override
public finalBuilder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
returnsuper.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target)
}
// @@protoc_insertion_point(class_scope:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target)private static final io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.TargetDEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target();
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getDefaultInstance() {
returnDEFAULT_INSTANCE;
}
private static final com.google.protobuf.ParserPARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Target 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) {
thrownew com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
returnPARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
returnPARSER;
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getDefaultInstanceForType() {
returnDEFAULT_INSTANCE;
}
}
public static final int TARGETS_FIELD_NUMBER = 1;
private static finalclassTargetsDefaultEntryHolder{
static final com.google.protobuf.MapEntry<
java.lang.String, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_TargetsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.getDefaultInstance());
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target> targets_;
private com.google.protobuf.MapField
internalGetTargets() {
if (targets_ == null) {
return com.google.protobuf.MapField.emptyMapField(
TargetsDefaultEntryHolder.defaultEntry);
}
return targets_;
}
public int getTargetsCount() {
return internalGetTargets().getMap().size();
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public boolean containsTargets(
java.lang.String key) {
if (key == null) { thrownewNullPointerException("map key"); }
return internalGetTargets().getMap().containsKey(key);
}
/**
* Use {@link #getTargetsMap()} instead.
*/@java.lang.Override@java.lang.Deprecated
public java.util.Map getTargets() {
return getTargetsMap();
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public java.util.Map getTargetsMap() {
return internalGetTargets().getMap();
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public /* nullable */
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getTargetsOrDefault(
java.lang.String key,
/* nullable */
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target defaultValue) {
if (key == null) { thrownewNullPointerException("map key"); }
java.util.Map map =
internalGetTargets().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getTargetsOrThrow(
java.lang.String key) {
if (key == null) { thrownewNullPointerException("map key"); }
java.util.Map map =
internalGetTargets().getMap();
if (!map.containsKey(key)) {
thrownew java.lang.IllegalArgumentException();
}
return map.get(key);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) returntrue;
if (isInitialized == 0) returnfalse;
memoizedIsInitialized = 1;
returntrue;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
com.google.protobuf.GeneratedMessageV3
.serializeStringMapTo(
output,
internalGetTargets(),
TargetsDefaultEntryHolder.defaultEntry,
1);
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
: internalGetTargets().getMap().entrySet()) {
com.google.protobuf.MapEntry
targets__ = TargetsDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, targets__);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
returntrue;
}
if (!(obj instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig)) {
returnsuper.equals(obj);
}
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig other = (io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig) obj;
if (!internalGetTargets().equals(
other.internalGetTargets())) returnfalse;
if (!getUnknownFields().equals(other.getUnknownFields())) returnfalse;
returntrue;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (!internalGetTargets().getMap().isEmpty()) {
hash = (37 * hash) + TARGETS_FIELD_NUMBER;
hash = (53 * hash) + internalGetTargets().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
returnPARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig 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.WeightedTargetLoadBalancingPolicyConfig parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig 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.WeightedTargetLoadBalancingPolicyConfig parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig 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() {
returnDEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig prototype) {
returnDEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
returnthis == DEFAULT_INSTANCE
? newBuilder() : newBuilder().mergeFrom(this);
}
@java.lang.OverrideprotectedBuilder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = newBuilder(parent);
return builder;
}
/**
*
* Configuration for weighted_target LB policy.
*
*
* Protobuf type {@code grpc.service_config.WeightedTargetLoadBalancingPolicyConfig}
*/
public static finalclassBuilderextends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig)
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfigOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case1:
return internalGetTargets();
default:
thrownewRuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case1:
return internalGetMutableTargets();
default:
thrownewRuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Overrideprotected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.class, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Builder.class);
}
// Construct using io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.newBuilder()privateBuilder() {
}
privateBuilder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
internalGetMutableTargets().clear();
returnthis;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_descriptor;
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig getDefaultInstanceForType() {
return io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.getDefaultInstance();
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig build() {
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig buildPartial() {
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig result = new io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.targets_ = internalGetTargets().build(TargetsDefaultEntryHolder.defaultEntry);
}
}
@java.lang.Override
public Builder clone() {
returnsuper.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
returnsuper.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
returnsuper.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
returnsuper.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
returnsuper.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
returnsuper.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig) {
return mergeFrom((io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig)other);
} else {
super.mergeFrom(other);
returnthis;
}
}
public Builder mergeFrom(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig other) {
if (other == io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.getDefaultInstance()) returnthis;
internalGetMutableTargets().mergeFrom(
other.internalGetTargets());
bitField0_ |= 0x00000001;
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
returnthis;
}
@java.lang.Override
public final boolean isInitialized() {
returntrue;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
thrownew java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case0:
done = true;
break;
case10: {
com.google.protobuf.MapEntry
targets__ = input.readMessage(
TargetsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
internalGetMutableTargets().ensureBuilderMap().put(
targets__.getKey(), targets__.getValue());
bitField0_ |= 0x00000001;
break;
} // case 10default: {
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();
} // finallyreturnthis;
}
private int bitField0_;
private static finalclassTargetsConverterimplementscom.google.protobuf.MapFieldBuilder.Converter{
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target build(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.TargetOrBuilderval) {
if (val instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target) { return (io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target) val; }
return ((io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.Builder) val).build();
}
@java.lang.Override
public com.google.protobuf.MapEntry defaultEntry() {
returnTargetsDefaultEntryHolder.defaultEntry;
}
};
private static finalTargetsConverter targetsConverter = newTargetsConverter();
private com.google.protobuf.MapFieldBuilder<
java.lang.String, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.TargetOrBuilder, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.Builder> targets_;
private com.google.protobuf.MapFieldBuilder
internalGetTargets() {
if (targets_ == null) {
returnnew com.google.protobuf.MapFieldBuilder<>(targetsConverter);
}
return targets_;
}
private com.google.protobuf.MapFieldBuilder
internalGetMutableTargets() {
if (targets_ == null) {
targets_ = new com.google.protobuf.MapFieldBuilder<>(targetsConverter);
}
bitField0_ |= 0x00000001;
onChanged();
return targets_;
}
public int getTargetsCount() {
return internalGetTargets().ensureBuilderMap().size();
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public boolean containsTargets(
java.lang.String key) {
if (key == null) { thrownewNullPointerException("map key"); }
return internalGetTargets().ensureBuilderMap().containsKey(key);
}
/**
* Use {@link #getTargetsMap()} instead.
*/@java.lang.Override@java.lang.Deprecated
public java.util.Map getTargets() {
return getTargetsMap();
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public java.util.Map getTargetsMap() {
return internalGetTargets().getImmutableMap();
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public /* nullable */
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getTargetsOrDefault(
java.lang.String key,
/* nullable */
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target defaultValue) {
if (key == null) { thrownewNullPointerException("map key"); }
java.util.Map map = internalGetMutableTargets().ensureBuilderMap();
return map.containsKey(key) ? targetsConverter.build(map.get(key)) : defaultValue;
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getTargetsOrThrow(
java.lang.String key) {
if (key == null) { thrownewNullPointerException("map key"); }
java.util.Map map = internalGetMutableTargets().ensureBuilderMap();
if (!map.containsKey(key)) {
thrownew java.lang.IllegalArgumentException();
}
return targetsConverter.build(map.get(key));
}
public Builder clearTargets() {
bitField0_ = (bitField0_ & ~0x00000001);
internalGetMutableTargets().clear();
returnthis;
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/
public Builder removeTargets(
java.lang.String key) {
if (key == null) { thrownewNullPointerException("map key"); }
internalGetMutableTargets().ensureBuilderMap()
.remove(key);
returnthis;
}
/**
* Use alternate mutation accessors instead.
*/@java.lang.Deprecated
public java.util.Map
getMutableTargets() {
bitField0_ |= 0x00000001;
return internalGetMutableTargets().ensureMessageMap();
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/
public Builder putTargets(
java.lang.String key,
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target value) {
if (key == null) { thrownewNullPointerException("map key"); }
if (value == null) { thrownewNullPointerException("map value"); }
internalGetMutableTargets().ensureBuilderMap()
.put(key, value);
bitField0_ |= 0x00000001;
returnthis;
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/
public Builder putAllTargets(
java.util.Map values) {
for (java.util.Map.Entry e : values.entrySet()) {
if (e.getKey() == null || e.getValue() == null) {
thrownewNullPointerException();
}
}
internalGetMutableTargets().ensureBuilderMap()
.putAll(values);
bitField0_ |= 0x00000001;
returnthis;
}
/**
* map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1;
*/
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.Builder putTargetsBuilderIfAbsent(
java.lang.String key) {
java.util.Map builderMap = internalGetMutableTargets().ensureBuilderMap();
io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.TargetOrBuilder entry = builderMap.get(key);
if (entry == null) {
entry = io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.newBuilder();
builderMap.put(key, entry);
}
if (entry instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target) {
entry = ((io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target) entry).toBuilder();
builderMap.put(key, entry);
}
return (io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.Builder) entry;
}
@java.lang.Override
public finalBuilder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
returnsuper.setUnknownFields(unknownFields);
}
@java.lang.Override
public finalBuilder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
returnsuper.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig)
}
// @@protoc_insertion_point(class_scope:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig)private static final io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfigDEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig();
}
public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig getDefaultInstance() {
returnDEFAULT_INSTANCE;
}
private static final com.google.protobuf.ParserPARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public WeightedTargetLoadBalancingPolicyConfig 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) {
thrownew com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
returnPARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
returnPARSER;
}
@java.lang.Override
public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig getDefaultInstanceForType() {
returnDEFAULT_INSTANCE;
}
}