Class GrpcRoute.Destination.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<GrpcRoute.Destination.Builder>
com.google.cloud.networkservices.v1.GrpcRoute.Destination.Builder
- All Implemented Interfaces:
GrpcRoute.DestinationOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- GrpcRoute.Destination
public static final class GrpcRoute.Destination.Builder
extends com.google.protobuf.GeneratedMessage.Builder<GrpcRoute.Destination.Builder>
implements GrpcRoute.DestinationOrBuilder
The destination to which traffic will be routed.Protobuf type
google.cloud.networkservices.v1.GrpcRoute.Destination-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Required.Optional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorRequired.com.google.protobuf.ByteStringRequired.intOptional.booleanRequired.booleanOptional.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(GrpcRoute.Destination other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setServiceName(String value) Required.setServiceNameBytes(com.google.protobuf.ByteString value) Required.setWeight(int value) Optional.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<GrpcRoute.Destination.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<GrpcRoute.Destination.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<GrpcRoute.Destination.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<GrpcRoute.Destination.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<GrpcRoute.Destination.Builder>
-
mergeFrom
public GrpcRoute.Destination.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<GrpcRoute.Destination.Builder>- Throws:
IOException
-
getDestinationTypeCase
- Specified by:
getDestinationTypeCasein interfaceGrpcRoute.DestinationOrBuilder
-
clearDestinationType
-
hasServiceName
public boolean hasServiceName()Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService.
string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Specified by:
hasServiceNamein interfaceGrpcRoute.DestinationOrBuilder- Returns:
- Whether the serviceName field is set.
-
getServiceName
Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService.
string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Specified by:
getServiceNamein interfaceGrpcRoute.DestinationOrBuilder- Returns:
- The serviceName.
-
getServiceNameBytes
public com.google.protobuf.ByteString getServiceNameBytes()Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService.
string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Specified by:
getServiceNameBytesin interfaceGrpcRoute.DestinationOrBuilder- Returns:
- The bytes for serviceName.
-
setServiceName
Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService.
string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Parameters:
value- The serviceName to set.- Returns:
- This builder for chaining.
-
clearServiceName
Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService.
string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Returns:
- This builder for chaining.
-
setServiceNameBytes
Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService.
string service_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Parameters:
value- The bytes for serviceName to set.- Returns:
- This builder for chaining.
-
hasWeight
public boolean hasWeight()Optional. Specifies the proportion of requests forwarded to the backend referenced by the serviceName field. This is computed as: - weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weights are specified for any one service name, they need to be specified for all of them. If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
optional int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
hasWeightin interfaceGrpcRoute.DestinationOrBuilder- Returns:
- Whether the weight field is set.
-
getWeight
public int getWeight()Optional. Specifies the proportion of requests forwarded to the backend referenced by the serviceName field. This is computed as: - weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weights are specified for any one service name, they need to be specified for all of them. If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
optional int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getWeightin interfaceGrpcRoute.DestinationOrBuilder- Returns:
- The weight.
-
setWeight
Optional. Specifies the proportion of requests forwarded to the backend referenced by the serviceName field. This is computed as: - weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weights are specified for any one service name, they need to be specified for all of them. If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
optional int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The weight to set.- Returns:
- This builder for chaining.
-
clearWeight
Optional. Specifies the proportion of requests forwarded to the backend referenced by the serviceName field. This is computed as: - weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weights are specified for any one service name, they need to be specified for all of them. If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
optional int32 weight = 2 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-