Package io.grpc

Class ConnectivityStateInfo


  • @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771")
    public final class ConnectivityStateInfo
    extends java.lang.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.

    • Method Detail

      • forNonError

        public static ConnectivityStateInfo forNonError​(ConnectivityState state)
        Returns an instance for a state that is not TRANSIENT_FAILURE.
        Throws:
        java.lang.IllegalArgumentException - if state is TRANSIENT_FAILURE.
      • forTransientFailure

        public static ConnectivityStateInfo forTransientFailure​(Status error)
        Returns an instance for TRANSIENT_FAILURE, associated with an error status.
      • getStatus

        public Status getStatus()
        Returns the status associated with the state.

        If the state is TRANSIENT_FAILURE, the status is never OK. For other states, the status is always OK.

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object