}
final Data keyData = toData(key);
final Data oldValueData = oldValue != null ? toData(oldValue) : null;
final Data newValueData = newValue != null ? toData(newValue) : null;
InMemoryFormat inMemoryFormat = cacheConfig.getInMemoryFormat();
ClientRequest request;
if (isGet) {
request = new CacheGetAndReplaceRequest(nameWithPrefix, keyData, newValueData, expiryPolicy, inMemoryFormat);
} else {
request = new CacheReplaceRequest(nameWithPrefix, keyData, oldValueData, newValueData, expiryPolicy, inMemoryFormat);