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 forNameResolver.ResolutionResult
.- Since:
- 1.21.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description NameResolver.ResolutionResult
build()
Constructs a newNameResolver.ResolutionResult
from this builder.NameResolver.ResolutionResult.Builder
setAddresses(List<EquivalentAddressGroup> addresses)
Deprecated.Will be superseded by setAddressesOrErrorNameResolver.ResolutionResult.Builder
setAddressesOrError(StatusOr<List<EquivalentAddressGroup>> addresses)
Sets the addresses resolved by name resolution or the error in doing so.NameResolver.ResolutionResult.Builder
setAttributes(Attributes attributes)
Sets the attributes for the addresses resolved by name resolution.NameResolver.ResolutionResult.Builder
setServiceConfig(NameResolver.ConfigOrError serviceConfig)
Sets the Service Config parsed byNameResolver.Args.getServiceConfigParser()
.
-
-
-
Method Detail
-
setAddresses
@Deprecated public NameResolver.ResolutionResult.Builder setAddresses(List<EquivalentAddressGroup> addresses)
Deprecated.Will be superseded by setAddressesOrErrorSets the addresses resolved by name resolution. This field is required.- Since:
- 1.21.0
-
setAddressesOrError
public NameResolver.ResolutionResult.Builder setAddressesOrError(StatusOr<List<EquivalentAddressGroup>> addresses)
Sets the addresses resolved by name resolution or the error in doing so. This field is required.- Parameters:
addresses
- Resolved addresses or an error in resolving addresses
-
setAttributes
public NameResolver.ResolutionResult.Builder setAttributes(Attributes attributes)
Sets the attributes for the addresses resolved by name resolution. If unset,Attributes.EMPTY
will 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
public NameResolver.ResolutionResult build()
Constructs a newNameResolver.ResolutionResult
from this builder.- Since:
- 1.21.0
-
-