org.apache.hc.core5.util

## Class TimeoutValueException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.util.concurrent.TimeoutException
      - - org.apache.hc.core5.util.TimeoutValueException

- All Implemented Interfaces:
    Serializable

      public class TimeoutValueException
      extends TimeoutException

  A specialization of `TimeoutException` that carries a `Timeout` deadline and the actual value.
  Since:
    5.0
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeoutValueException(Timeout deadline, Timeout actual)` Creates a new exception for the given timeout deadline and actual timeout.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TimeoutValueException` | `fromMilliseconds(long timeoutDeadline, long timeoutActual)` Creates a new exception for the given timeout deadline and actual timeout.
    `Timeout` | `getActual()` Gets how long was the expected timeout in milliseconds.
    `Timeout` | `getDeadline()` Gets how long we actually waited in milliseconds.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TimeoutValueException

          public TimeoutValueException(Timeout deadline,
                                       Timeout actual)

      Creates a new exception for the given timeout deadline and actual timeout.
      Parameters:
        `deadline` - How long was the expected timeout.
        `actual` - How long we actually waited.

  - ### Method Detail

    - #### fromMilliseconds

          public static TimeoutValueException fromMilliseconds(long timeoutDeadline,
                                                               long timeoutActual)

      Creates a new exception for the given timeout deadline and actual timeout.
      Parameters:
        `timeoutDeadline` - How long was the expected timeout in milliseconds.
        `timeoutActual` - How long we actually waited in milliseconds.
      Returns:
        a new TimeoutValueException.

    - #### getActual

          public Timeout getActual()

      Gets how long was the expected timeout in milliseconds.
      Returns:
        how long was the expected timeout in milliseconds.

    - #### getDeadline

          public Timeout getDeadline()

      Gets how long we actually waited in milliseconds.
      Returns:
        how long we actually waited in milliseconds.

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.