Package io.grpc
Class NameResolver.ResolutionResult.Builder
java.lang.Object
io.grpc.NameResolver.ResolutionResult.Builder
- Enclosing class:
- NameResolver.ResolutionResult
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770")
public static final class NameResolver.ResolutionResult.Builder
extends Object
A builder for
NameResolver.ResolutionResult.- Since:
- 1.21.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs a newNameResolver.ResolutionResultfrom this builder.setAddresses(List<EquivalentAddressGroup> addresses) Sets the addresses resolved by name resolution.setAttributes(Attributes attributes) Sets the attributes for the addresses resolved by name resolution.setServiceConfig(NameResolver.ConfigOrError serviceConfig) Sets the Service Config parsed byNameResolver.Args.getServiceConfigParser().
-
Method Details
-
setAddresses
Sets the addresses resolved by name resolution. This field is required.- Since:
- 1.21.0
-
setAttributes
Sets the attributes for the addresses resolved by name resolution. If unset,Attributes.EMPTYwill be used as a default.- Since:
- 1.21.0
-
setServiceConfig
public NameResolver.ResolutionResult.Builder setServiceConfig(@Nullable NameResolver.ConfigOrError serviceConfig) Sets the Service Config parsed byNameResolver.Args.getServiceConfigParser(). This field is optional.- Since:
- 1.21.0
-
build
Constructs a newNameResolver.ResolutionResultfrom this builder.- Since:
- 1.21.0
-