Class PingResponse


  • public class PingResponse
    extends Object
    Ping response reacts to response of Ping call. If operation failed, *failure() methods will be called. If operation succeeds, *success() method will be called.
    • Constructor Detail

      • PingResponse

        public PingResponse​(boolean operationFailed,
                            RuntimeException exception)
      • PingResponse

        public PingResponse​(boolean operationFailed)
    • Method Detail

      • callOnSuccess

        public PingResponse callOnSuccess​(Runnable runnable)
        On success call Runnable
        Parameters:
        runnable - Runnable to call
        Returns:
        Current PingResponse object, which can be used to define what happens on failure. On failure exception should be either catched, or re-thrown.
      • throwOnFailure

        public void throwOnFailure​(UnaryOperator<RuntimeException> function)
        Throw user-defined exception on failure
        Parameters:
        function - Function, input: original exception, output: user-defined exception
      • throwOnFailure

        public void throwOnFailure()
        Throw original exception on failure
      • catchOnFailure

        public void catchOnFailure​(Consumer<RuntimeException> consumer)
        On failure call consumer.
        Parameters:
        consumer - Consumer to call