@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/1771") public final class ConnectivityStateInfo extends Object
ConnectivityState
and its associated Status
.
If the state is TRANSIENT_FAILURE
, the status is never OK
. For other states,
the status is always OK
.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
static ConnectivityStateInfo |
forNonError(ConnectivityState state)
Returns an instance for a state that is not
TRANSIENT_FAILURE . |
static ConnectivityStateInfo |
forTransientFailure(Status error)
Returns an instance for
TRANSIENT_FAILURE , associated with an error status. |
ConnectivityState |
getState()
Returns the state.
|
Status |
getStatus()
Returns the status associated with the state.
|
int |
hashCode() |
String |
toString() |
public static ConnectivityStateInfo forNonError(ConnectivityState state)
TRANSIENT_FAILURE
.IllegalArgumentException
- if state
is TRANSIENT_FAILURE
.public static ConnectivityStateInfo forTransientFailure(Status error)
TRANSIENT_FAILURE
, associated with an error status.public ConnectivityState getState()
public Status getStatus()
If the state is TRANSIENT_FAILURE
, the status is never OK
. For other
states, the status is always OK
.