Class JRedis<T>

Type Parameters:
T -
All Implemented Interfaces:
DistributedCacheClient<T>

public class JRedis<T> extends AbstractDistributedCacheClient<T>
Since:
0.8
Author:
Haiyang Li
  • Constructor Details

    • JRedis

      public JRedis(String serverUrl)
      Parameters:
      serverUrl -
    • JRedis

      public JRedis(String serverUrl, long timeout)
      Parameters:
      serverUrl -
      timeout -
  • Method Details

    • get

      public T get(String key)
      Parameters:
      key -
      Returns:
    • set

      public boolean set(String key, T obj, long liveTime)
      Parameters:
      key -
      obj -
      liveTime -
      Returns:
      true, if successful
    • delete

      public boolean delete(String key)
      Parameters:
      key -
      Returns:
      true, if successful
    • incr

      public long incr(String key)
      Parameters:
      key -
      Returns:
    • incr

      public long incr(String key, int deta)
      Parameters:
      key -
      deta -
      Returns:
    • decr

      public long decr(String key)
      Parameters:
      key -
      Returns:
    • decr

      public long decr(String key, int deta)
      Parameters:
      key -
      deta -
      Returns:
    • flushAll

      public void flushAll()
      Flush all.
      Specified by:
      flushAll in interface DistributedCacheClient<T>
      Overrides:
      flushAll in class AbstractDistributedCacheClient<T>
    • disconnect

      public void disconnect()
      Disconnect.