/** * An atomic operation that rewrite the record. Generation and time-to-live are updated. * The provided field value will be converted to the property value, based on the converters defined via the class mapping. * */ public SingleKeyCommander<T> touch() { operations.add(Operation.touch()); return this; }
private Record getAndTouch(Key key, int expiration) { WritePolicy writePolicy = new WritePolicy(client.writePolicyDefault); writePolicy.expiration = expiration; return this.client.operate(writePolicy, key, Operation.touch(), Operation.get()); }
Record record = client.operate(writePolicy, key, Operation.touch(), Operation.getHeader());