Package io.grpc
Class NameResolver.ResolutionResult
- java.lang.Object
-
- io.grpc.NameResolver.ResolutionResult
-
- Enclosing class:
- NameResolver
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770") public static final class NameResolver.ResolutionResult extends java.lang.Object
Represents the results from a Name Resolver.- Since:
- 1.21.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NameResolver.ResolutionResult.Builder
A builder forNameResolver.ResolutionResult
.
-
Field Summary
Fields Modifier and Type Field Description private StatusOr<java.util.List<EquivalentAddressGroup>>
addressesOrError
private Attributes
attributes
private NameResolver.ConfigOrError
serviceConfig
-
Constructor Summary
Constructors Constructor Description ResolutionResult(StatusOr<java.util.List<EquivalentAddressGroup>> addressesOrError, Attributes attributes, NameResolver.ConfigOrError serviceConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Useful for testing.java.util.List<EquivalentAddressGroup>
getAddresses()
Deprecated.Will be superseded by getAddressesOrErrorStatusOr<java.util.List<EquivalentAddressGroup>>
getAddressesOrError()
Gets the addresses resolved by name resolution or the error in doing so.Attributes
getAttributes()
Gets the attributes associated with the addresses resolved by name resolution.NameResolver.ConfigOrError
getServiceConfig()
Gets the Service Config parsed byNameResolver.Args.getServiceConfigParser()
.int
hashCode()
Useful for testing.static NameResolver.ResolutionResult.Builder
newBuilder()
Constructs a new builder of a name resolution result.NameResolver.ResolutionResult.Builder
toBuilder()
Converts these results back to a builder.java.lang.String
toString()
-
-
-
Field Detail
-
addressesOrError
private final StatusOr<java.util.List<EquivalentAddressGroup>> addressesOrError
-
attributes
@ResolutionResultAttr private final Attributes attributes
-
serviceConfig
@Nullable private final NameResolver.ConfigOrError serviceConfig
-
-
Constructor Detail
-
ResolutionResult
ResolutionResult(StatusOr<java.util.List<EquivalentAddressGroup>> addressesOrError, @ResolutionResultAttr Attributes attributes, NameResolver.ConfigOrError serviceConfig)
-
-
Method Detail
-
newBuilder
public static NameResolver.ResolutionResult.Builder newBuilder()
Constructs a new builder of a name resolution result.- Since:
- 1.21.0
-
toBuilder
public NameResolver.ResolutionResult.Builder toBuilder()
Converts these results back to a builder.- Since:
- 1.21.0
-
getAddresses
@Deprecated public java.util.List<EquivalentAddressGroup> getAddresses()
Deprecated.Will be superseded by getAddressesOrErrorGets the addresses resolved by name resolution.- Since:
- 1.21.0
-
getAddressesOrError
public StatusOr<java.util.List<EquivalentAddressGroup>> getAddressesOrError()
Gets the addresses resolved by name resolution or the error in doing so.- Since:
- 1.65.0
-
getAttributes
@ResolutionResultAttr public Attributes getAttributes()
Gets the attributes associated with the addresses resolved by name resolution. If there are no attributes,Attributes.EMPTY
will be returned.- Since:
- 1.21.0
-
getServiceConfig
@Nullable public NameResolver.ConfigOrError getServiceConfig()
Gets the Service Config parsed byNameResolver.Args.getServiceConfigParser()
.- Since:
- 1.21.0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Useful for testing. May be slow to calculate.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Useful for testing. May be slow to calculate.- Overrides:
hashCode
in classjava.lang.Object
-
-