All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig Maven / Gradle / Ivy

There is a newer version: 2.51.0
Show newest version
// 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 weighted_target LB policy.
 * 
* * Protobuf type {@code grpc.service_config.WeightedTargetLoadBalancingPolicyConfig} */ public final class WeightedTargetLoadBalancingPolicyConfig extends 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. private WeightedTargetLoadBalancingPolicyConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private WeightedTargetLoadBalancingPolicyConfig() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new WeightedTargetLoadBalancingPolicyConfig(); } 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.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 1: return internalGetTargets(); 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_WeightedTargetLoadBalancingPolicyConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.class, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Builder.class); } public interface TargetOrBuilder extends // @@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 final class Target extends 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. private Target(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Target() { childPolicy_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Target(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.grpc.serviceconfig.ServiceConfigProto.internal_static_grpc_service_config_WeightedTargetLoadBalancingPolicyConfig_Target_descriptor; } @java.lang.Override protected 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) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (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) { return true; } if (!(obj instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target)) { return super.equals(obj); } io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target other = (io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target) obj; if (getWeight() != other.getWeight()) return false; if (!getChildPolicyList() .equals(other.getChildPolicyList())) 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(); 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 { return PARSER.parseFrom(data); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target 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.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.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 { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.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() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target} */ public static final class Builder extends 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.Override protected 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() private Builder() { } private Builder( 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); return this; } @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() { 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.WeightedTargetLoadBalancingPolicyConfig.Target) { return mergeFrom((io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target other) { if (other == io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target.getDefaultInstance()) return this; 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(); 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 8: { weight_ = input.readUInt32(); bitField0_ |= 0x00000001; break; } // case 8 case 18: { 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 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 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(); return this; } /** * uint32 weight = 1; * @return This builder for chaining. */ public Builder clearWeight() { bitField0_ = (bitField0_ & ~0x00000001); weight_ = 0; onChanged(); return this; } 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) { throw new NullPointerException(); } ensureChildPolicyIsMutable(); childPolicy_.set(index, value); onChanged(); } else { childPolicyBuilder_.setMessage(index, value); } return this; } /** * 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()); } return this; } /** * repeated .grpc.service_config.LoadBalancingConfig child_policy = 2; */ public Builder addChildPolicy(io.grpc.serviceconfig.LoadBalancingConfig value) { if (childPolicyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureChildPolicyIsMutable(); childPolicy_.add(value); onChanged(); } else { childPolicyBuilder_.addMessage(value); } return this; } /** * repeated .grpc.service_config.LoadBalancingConfig child_policy = 2; */ public Builder addChildPolicy( int index, io.grpc.serviceconfig.LoadBalancingConfig value) { if (childPolicyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureChildPolicyIsMutable(); childPolicy_.add(index, value); onChanged(); } else { childPolicyBuilder_.addMessage(index, value); } return this; } /** * 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()); } return this; } /** * 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()); } return this; } /** * 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); } return this; } /** * 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(); } return this; } /** * 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); } return this; } /** * 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 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.WeightedTargetLoadBalancingPolicyConfig.Target) } // @@protoc_insertion_point(class_scope:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target) private static final io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target(); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = 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) { 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.WeightedTargetLoadBalancingPolicyConfig.Target getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public static final int TARGETS_FIELD_NUMBER = 1; private static final class TargetsDefaultEntryHolder { 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) { throw new NullPointerException("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) { throw new NullPointerException("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) { throw new NullPointerException("map key"); } java.util.Map map = internalGetTargets().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } 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, 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) { return true; } if (!(obj instanceof io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig)) { return super.equals(obj); } io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig other = (io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig) obj; if (!internalGetTargets().equals( other.internalGetTargets())) 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 (!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 { return PARSER.parseFrom(data); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig 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.WeightedTargetLoadBalancingPolicyConfig parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig 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.WeightedTargetLoadBalancingPolicyConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.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() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig 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 weighted_target LB policy.
   * 
* * Protobuf type {@code grpc.service_config.WeightedTargetLoadBalancingPolicyConfig} */ public static final class Builder extends 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) { case 1: return internalGetTargets(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( int number) { switch (number) { case 1: return internalGetMutableTargets(); 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_WeightedTargetLoadBalancingPolicyConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.class, io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Builder.class); } // Construct using io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.newBuilder() private Builder() { } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; internalGetMutableTargets().clear(); return this; } @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() { 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.WeightedTargetLoadBalancingPolicyConfig) { return mergeFrom((io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig other) { if (other == io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.getDefaultInstance()) return this; internalGetMutableTargets().mergeFrom( other.internalGetTargets()); bitField0_ |= 0x00000001; 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 targets__ = input.readMessage( TargetsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableTargets().ensureBuilderMap().put( targets__.getKey(), targets__.getValue()); bitField0_ |= 0x00000001; break; } // case 10 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 TargetsConverter implements com.google.protobuf.MapFieldBuilder.Converter { @java.lang.Override public io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.Target build(io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig.TargetOrBuilder val) { 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() { return TargetsDefaultEntryHolder.defaultEntry; } }; private static final TargetsConverter targetsConverter = new TargetsConverter(); 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) { return new 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) { throw new NullPointerException("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) { throw new NullPointerException("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) { throw new NullPointerException("map key"); } java.util.Map map = internalGetMutableTargets().ensureBuilderMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return targetsConverter.build(map.get(key)); } public Builder clearTargets() { bitField0_ = (bitField0_ & ~0x00000001); internalGetMutableTargets().clear(); return this; } /** * map<string, .grpc.service_config.WeightedTargetLoadBalancingPolicyConfig.Target> targets = 1; */ public Builder removeTargets( java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableTargets().ensureBuilderMap() .remove(key); return this; } /** * 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) { throw new NullPointerException("map key"); } if (value == null) { throw new NullPointerException("map value"); } internalGetMutableTargets().ensureBuilderMap() .put(key, value); bitField0_ |= 0x00000001; return this; } /** * 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) { throw new NullPointerException(); } } internalGetMutableTargets().ensureBuilderMap() .putAll(values); bitField0_ |= 0x00000001; return this; } /** * 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 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.WeightedTargetLoadBalancingPolicyConfig) } // @@protoc_insertion_point(class_scope:grpc.service_config.WeightedTargetLoadBalancingPolicyConfig) private static final io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig(); } public static io.grpc.serviceconfig.WeightedTargetLoadBalancingPolicyConfig getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = 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) { 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.WeightedTargetLoadBalancingPolicyConfig getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy