Permalink
Browse files

touge: allow built-in cache to be extended.

  • Loading branch information...
1 parent 1933faf commit 9da6384f583978d0a6c5ecdb58e93e8b60025c08 @kgilmer committed Feb 4, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 org.touge.restclient/src/main/java/org/touge/restclient/RestClient.java
@@ -364,12 +364,14 @@ public String getMimeType() {
}
}
+ /**
+ * Simple cache implementation using a HashMap backend.
+ */
public static class HashMapCache implements RestClient.HttpGETCache {
- private Object[] data;
- private final int CONTENT_INDEX = 0;
- private final int HEADERS_INDEX = 1;
- private final int CODE_INDEX = 2;
- private final Map<String, Object[]> cache = new HashMap<String, Object[]>();
+ protected final int CONTENT_INDEX = 0;
+ protected final int HEADERS_INDEX = 1;
+ protected final int CODE_INDEX = 2;
+ protected final Map<String, Object[]> cache = new HashMap<String, Object[]>();
@Override
public HttpGETCacheEntry get(final String key) {

0 comments on commit 9da6384

Please sign in to comment.