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 classNameResolver.ResolutionResult.BuilderA builder forNameResolver.ResolutionResult.
-
Field Summary
Fields Modifier and Type Field Description private StatusOr<java.util.List<EquivalentAddressGroup>>addressesOrErrorprivate Attributesattributesprivate NameResolver.ConfigOrErrorserviceConfig
-
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 booleanequals(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.AttributesgetAttributes()Gets the attributes associated with the addresses resolved by name resolution.NameResolver.ConfigOrErrorgetServiceConfig()Gets the Service Config parsed byNameResolver.Args.getServiceConfigParser().inthashCode()Useful for testing.static NameResolver.ResolutionResult.BuildernewBuilder()Constructs a new builder of a name resolution result.NameResolver.ResolutionResult.BuildertoBuilder()Converts these results back to a builder.java.lang.StringtoString()
-
-
-
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.EMPTYwill 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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Useful for testing. May be slow to calculate.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Useful for testing. May be slow to calculate.- Overrides:
hashCodein classjava.lang.Object
-
-