Top Description Fields Constructors Methods
org.apache.hc.core5.util

public Class TimeoutValueException

extends TimeoutException
Class Inheritance
Imports
java.util.concurrent.TimeoutException

A specialization of TimeoutException that carries a Timeout deadline and the actual value.
Since
5.0

Field Summary

Modifier and TypeField and Description
private final Timeout
private final Timeout
private static final long

Constructor Summary

AccessConstructor and Description
public
TimeoutValueException(final Timeout
How long was the expected timeout.
deadline
,
final Timeout
How long we actually waited.
actual
)

Creates a new exception for the given timeout deadline and actual timeout.

Method Summary

Modifier and TypeMethod and Description
public static TimeoutValueException

Returns:

a new TimeoutValueException.
fromMilliseconds
(final long
How long was the expected timeout in milliseconds.
timeoutDeadline
,
final long
How long we actually waited in milliseconds.
timeoutActual
)

Creates a new exception for the given timeout deadline and actual timeout.

public Timeout

Returns:

how long was the expected timeout in milliseconds.
getActual
()

Gets how long was the expected timeout in milliseconds.

public Timeout

Returns:

how long we actually waited in milliseconds.
getDeadline
()

Gets how long we actually waited in milliseconds.

private static long

Returns:

the given value if positive, otherwise returns 0.
min0
(final long
any timeout
value
)

Returns the given value if positive, otherwise returns 0.

Field Detail

actualback to summary
private final Timeout actual
deadlineback to summary
private final Timeout deadline
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.TimeoutException.serialVersionUID.

Constructor Detail

TimeoutValueExceptionback to summary
public TimeoutValueException(final Timeout deadline, final Timeout actual)

Creates a new exception for the given timeout deadline and actual timeout.

Parameters
deadline:Timeout

How long was the expected timeout.

actual:Timeout

How long we actually waited.

Method Detail

fromMillisecondsback to summary
public static TimeoutValueException fromMilliseconds(final long timeoutDeadline, final long timeoutActual)

Creates a new exception for the given timeout deadline and actual timeout.

Parameters
timeoutDeadline:long

How long was the expected timeout in milliseconds.

timeoutActual:long

How long we actually waited in milliseconds.

Returns:TimeoutValueException

a new TimeoutValueException.

getActualback to summary
public Timeout getActual()

Gets how long was the expected timeout in milliseconds.

Returns:Timeout

how long was the expected timeout in milliseconds.

getDeadlineback to summary
public Timeout getDeadline()

Gets how long we actually waited in milliseconds.

Returns:Timeout

how long we actually waited in milliseconds.

min0back to summary
private static long min0(final long value)

Returns the given value if positive, otherwise returns 0.

Parameters
value:long

any timeout

Returns:long

the given value if positive, otherwise returns 0.