Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

touge: allow built-in cache to be extended.

  • Loading branch information...
commit 9da6384f583978d0a6c5ecdb58e93e8b60025c08 1 parent 1933faf
@kgilmer authored
View
12 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) {
Please sign in to comment.
Something went wrong with that request. Please try again.