/** * Prepend to an existing value in the cache. * * @param cas cas identifier (ignored in the ascii protocol) * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue * is too full to accept any more requests */ public Future<Boolean> prepend(long cas, String key, Object val) { return prepend(cas, key, val, transcoder); }
/** * Prepend to an existing value in the cache. * * <p>Note that the return will be false any time a mutation has not * occurred.</p> * * @param cas cas identifier (ignored in the ascii protocol) * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue * is too full to accept any more requests */ public Future<Boolean> prepend(long cas, String key, Object val) { return prepend(cas, key, val, transcoder); }
/** * Prepend to an existing value in the cache. * * <p> * Note that the return will be false any time a mutation has not occurred. * </p> * * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue is too * full to accept any more requests */ @Override public OperationFuture<Boolean> prepend(String key, Object val) { return prepend(0, key, val, transcoder); }
/** * Prepend to an existing value in the cache. * * <p> * Note that the return will be false any time a mutation has not occurred. * </p> * * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue is too * full to accept any more requests */ @Override public OperationFuture<Boolean> prepend(String key, Object val) { return prepend(0, key, val, transcoder); }
/** * Prepend to an existing value in the cache. * * <p>Note that the return will be false any time a mutation has not * occurred.</p> * * @param cas cas identifier (ignored in the ascii protocol) * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue * is too full to accept any more requests */ public Future<Boolean> prepend(long cas, String key, Object val) { return prepend(cas, key, val, transcoder); }
/** * Prepend to an existing value in the cache. * * <p> * Note that the return will be false any time a mutation has not occurred. * </p> * * @param cas cas identifier (ignored in the ascii protocol) * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue is too * full to accept any more requests */ public OperationFuture<Boolean> prepend(long cas, String key, Object val) { return prepend(cas, key, val, transcoder); }
/** * Prepend to an existing value in the cache. * * If 0 is passed in as the CAS identifier, it will override the value * on the server without performing the CAS check. * * <p> * Note that the return will be false any time a mutation has not occurred. * </p> * * @param cas cas identifier (ignored in the ascii protocol) * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue is too * full to accept any more requests */ @Override public OperationFuture<Boolean> prepend(long cas, String key, Object val) { return prepend(cas, key, val, transcoder); }
/** * Prepend to an existing value in the cache. * * If 0 is passed in as the CAS identifier, it will override the value * on the server without performing the CAS check. * * <p> * Note that the return will be false any time a mutation has not occurred. * </p> * * @param cas cas identifier (ignored in the ascii protocol) * @param key the key to whose value will be prepended * @param val the value to append * @return a future indicating success * @throws IllegalStateException in the rare circumstance where queue is too * full to accept any more requests */ @Override public OperationFuture<Boolean> prepend(long cas, String key, Object val) { return prepend(cas, key, val, transcoder); }
public void testPrepend() throws Exception { MemcachedClient client = bootstrapClient(); Future<Boolean> b = client.prepend(0, "key", "prepended"); assertTrue(b.get()); assertEquals("prependedmyStringValue", client.get("key")); b = client.prepend(0, "prependkey", "val"); assertFalse(b.get()); assertNull(client.get("prependkey")); }
break; case prepend: future = client.prepend(0L, key, value); break; default: