Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.data.redis.core
Class TimeoutUtils

    java.lang.Object
      org.springframework.data.redis.core.TimeoutUtils

    public abstract class TimeoutUtils

extends Object

Helper class featuring methods for calculating Redis timeouts

Constructor Summary
`TimeoutUtils()`

Method Summary
`static long` | `toMillis(long timeout, TimeUnit unit)` Converts the given timeout to milliseconds.
`static long` | `toSeconds(long timeout, TimeUnit unit)` Converts the given timeout to seconds.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TimeoutUtils

    public TimeoutUtils()

Method Detail

### toSeconds

    public static long toSeconds(long timeout,
                                 TimeUnit unit)

  Converts the given timeout to seconds.

  Since a 0 timeout blocks some Redis ops indefinitely, this method will return 1 if the original value is greater than 0 but is truncated to 0 on conversion.

  Parameters:
    `timeout` - The timeout to convert
    `unit` - The timeout's unit
  Returns:
    The converted timeout

### toMillis

    public static long toMillis(long timeout,
                                TimeUnit unit)

  Converts the given timeout to milliseconds.

  Since a 0 timeout blocks some Redis ops indefinitely, this method will return 1 if the original value is greater than 0 but is truncated to 0 on conversion.

  Parameters:
    `timeout` - The timeout to convert
    `unit` - The timeout's unit
  Returns:
    The converted timeout

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD