@@ -568,6 +568,7 @@ public boolean delete(String key) {
568568 /**
569569 * Deletes an object from cache given cache key and expiration date.
570570 *
571+ * @deprecated not supported in memcached 1.4+
571572 * @param key
572573 * the key to be removed
573574 * @param expiry
@@ -590,6 +591,7 @@ public boolean delete(String key, Date expiry) {
590591 * specified time. However, {@link #set(String, Object) set} will succeed,<br/>
591592 * and the new value will not be deleted.
592593 *
594+ * @deprecated not supported in memcached 1.4+
593595 * @param key
594596 * the key to be removed
595597 * @param hashCode
@@ -799,8 +801,8 @@ public boolean replace(String key, Object value, Date expiry, Integer hashCode)
799801 * number to store
800802 * @return true/false indicating success
801803 */
802- public boolean storeCounter (String key , long counter ) {
803- return storeCounter (key , new Long ( counter ) );
804+ public boolean storeCounter (String key , Long counter ) {
805+ return storeCounter (key , counter , null , null );
804806 }
805807
806808 /**
@@ -810,10 +812,29 @@ public boolean storeCounter(String key, long counter) {
810812 * cache key
811813 * @param counter
812814 * number to store
815+ * @param date
816+ * when to expire the record
813817 * @return true/false indicating success
814818 */
815- public boolean storeCounter (String key , Long counter ) {
816- return storeCounter (key , counter , null );
819+ public boolean storeCounter (String key , Long counter , Date date ) {
820+ return storeCounter (key , counter , date , null );
821+ }
822+
823+ /**
824+ * Store a counter to memcached given a key
825+ *
826+ * @param key
827+ * cache key
828+ * @param counter
829+ * number to store
830+ * @param date
831+ * when to expire the record
832+ * @param hashCode
833+ * if not null, then the int hashcode to use
834+ * @return true/false indicating success
835+ */
836+ public boolean storeCounter (String key , Long counter , Date date , Integer hashCode ) {
837+ return set (key , counter , date , hashCode );
817838 }
818839
819840 /**
@@ -828,7 +849,7 @@ public boolean storeCounter(String key, Long counter) {
828849 * @return true/false indicating success
829850 */
830851 public boolean storeCounter (String key , Long counter , Integer hashCode ) {
831- return set (key , counter , hashCode );
852+ return storeCounter (key , counter , null , hashCode );
832853 }
833854
834855 /**
@@ -955,7 +976,9 @@ public long addOrDecr(String key, long inc, Integer hashCode) {
955976 }
956977
957978 /**
958- * Increment the value at the specified key by 1, and then return it.
979+ * Increment the value at the specified key by 1, and then return it.<br>
980+ * Please make sure setPrimitiveAsString=true if the key/value pair is
981+ * stored with set command.
959982 *
960983 * @param key
961984 * key where the data is stored
@@ -967,7 +990,9 @@ public long incr(String key) {
967990 }
968991
969992 /**
970- * Increment the value at the specified key by passed in val.
993+ * Increment the value at the specified key by passed in val.<br>
994+ * Please make sure setPrimitiveAsString=true if the key/value pair is
995+ * stored with set command.
971996 *
972997 * @param key
973998 * key where the data is stored
@@ -982,7 +1007,9 @@ public long incr(String key, long inc) {
9821007
9831008 /**
9841009 * Increment the value at the specified key by the specified increment, and
985- * then return it.
1010+ * then return it.<br>
1011+ * Please make sure setPrimitiveAsString=true if the key/value pair is
1012+ * stored with set command.
9861013 *
9871014 * @param key
9881015 * key where the data is stored
@@ -998,7 +1025,9 @@ public long incr(String key, long inc, Integer hashCode) {
9981025 }
9991026
10001027 /**
1001- * Decrement the value at the specified key by 1, and then return it.
1028+ * Decrement the value at the specified key by 1, and then return it.<br>
1029+ * Please make sure setPrimitiveAsString=true if the key/value pair is
1030+ * stored with set command.
10021031 *
10031032 * @param key
10041033 * key where the data is stored
@@ -1011,7 +1040,9 @@ public long decr(String key) {
10111040
10121041 /**
10131042 * Decrement the value at the specified key by passed in value, and then
1014- * return it.
1043+ * return it.<br>
1044+ * Please make sure setPrimitiveAsString=true if the key/value pair is
1045+ * stored with set command.
10151046 *
10161047 * @param key
10171048 * key where the data is stored
@@ -1026,7 +1057,9 @@ public long decr(String key, long inc) {
10261057
10271058 /**
10281059 * Decrement the value at the specified key by the specified increment, and
1029- * then return it.
1060+ * then return it.<br>
1061+ * Please make sure setPrimitiveAsString=true if the key/value pair is
1062+ * stored with set command.
10301063 *
10311064 * @param key
10321065 * key where the data is stored
0 commit comments