diff --git a/src/com/meetup/memcached/MemcachedClient.java b/src/com/meetup/memcached/MemcachedClient.java index c17c1fa..6017d22 100644 --- a/src/com/meetup/memcached/MemcachedClient.java +++ b/src/com/meetup/memcached/MemcachedClient.java @@ -542,6 +542,19 @@ public boolean set( String key, Object value, Date expiry ) { return set( "set", key, value, expiry, null, primitiveAsString ); } + /** + * Stores data on the server; the key, value, and an expiration time are specified. + * + * @param key key to store data under + * @param value value to store + * @param expiry when to expire the record + * @return true, if the data was successfully stored + */ + public boolean set( String key, Object value, int expirySecond ) { + Date expiry = new Date((System.currentTimeMillis)/1000 + expirySecond); + return set( "set", key, value, expiry, null, primitiveAsString ); + } + /** * Stores data on the server; the key, value, and an expiration time are specified. *