diff options
Diffstat (limited to 'same/src/main/java/com/orbekk/same/Same.java')
-rw-r--r-- | same/src/main/java/com/orbekk/same/Same.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/same/src/main/java/com/orbekk/same/Same.java b/same/src/main/java/com/orbekk/same/Same.java new file mode 100644 index 0000000..b70c7aa --- /dev/null +++ b/same/src/main/java/com/orbekk/same/Same.java @@ -0,0 +1,42 @@ +package com.orbekk.same; + +import java.util.List; + +import org.codehaus.jackson.type.TypeReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Same implements SameInterface { + private Logger logger = LoggerFactory.getLogger(getClass()); + private ClientServiceImpl client; + + public Same(ClientServiceImpl client) { + this.client = client; + } + + @Override + public String get(String id) { + return client.lib_get(id); + } + + @Override + public <T> T get(String id, TypeReference<T> type) { + return client.lib_get(id, type); + } + + @Override + public List<String> getList(String id) { + return client.lib_get(id, new TypeReference<List<String>>() { }); + } + + @Override + public void set(String id, String data) throws UpdateConflict { + client.lib_set(id, data); + } + + @Override + public void setObject(String id, Object data) { + throw new RuntimeException("Not implemented."); + } + +} |