Class ConnectivityStateInfo
java.lang.Object
io.grpc.ConnectivityStateInfo
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771")
public final class ConnectivityStateInfo
extends Object
A tuple of a
ConnectivityState and its associated Status.
If the state is TRANSIENT_FAILURE, the status is never OK. For other states,
the status is always OK.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConnectivityStateInfo(ConnectivityState state, Status status) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ConnectivityStateInfoforNonError(ConnectivityState state) Returns an instance for a state that is notTRANSIENT_FAILURE.static ConnectivityStateInfoforTransientFailure(Status error) Returns an instance forTRANSIENT_FAILURE, associated with an error status.getState()Returns the state.Returns the status associated with the state.inthashCode()toString()
-
Field Details
-
state
-
status
-
-
Constructor Details
-
ConnectivityStateInfo
-
-
Method Details
-
forNonError
Returns an instance for a state that is notTRANSIENT_FAILURE.- Throws:
IllegalArgumentException- ifstateisTRANSIENT_FAILURE.
-
forTransientFailure
Returns an instance forTRANSIENT_FAILURE, associated with an error status. -
getState
Returns the state. -
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
-
hashCode
-
toString
-