Package io.grpc
Class ConnectivityStateInfo
- java.lang.Object
-
- io.grpc.ConnectivityStateInfo
-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771") public final class ConnectivityStateInfo extends java.lang.Object
A tuple of aConnectivityState
and its associatedStatus
.If the state is
TRANSIENT_FAILURE
, the status is neverOK
. For other states, the status is alwaysOK
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
static ConnectivityStateInfo
forNonError(ConnectivityState state)
Returns an instance for a state that is notTRANSIENT_FAILURE
.static ConnectivityStateInfo
forTransientFailure(Status error)
Returns an instance forTRANSIENT_FAILURE
, associated with an error status.ConnectivityState
getState()
Returns the state.Status
getStatus()
Returns the status associated with the state.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
forNonError
public static ConnectivityStateInfo forNonError(ConnectivityState state)
Returns an instance for a state that is notTRANSIENT_FAILURE
.- Throws:
java.lang.IllegalArgumentException
- ifstate
isTRANSIENT_FAILURE
.
-
forTransientFailure
public static ConnectivityStateInfo forTransientFailure(Status error)
Returns an instance forTRANSIENT_FAILURE
, associated with an error status.
-
getState
public ConnectivityState getState()
Returns the state.
-
getStatus
public Status getStatus()
Returns the status associated with the state.If the state is
TRANSIENT_FAILURE
, the status is neverOK
. For other states, the status is alwaysOK
.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-