Skip to content

Commit 9a1b77b

Browse files
committed
add isExpired to HttpCache
1 parent cf9eaa0 commit 9a1b77b

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/cn/trinea/android/common/service/HttpCache.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ public boolean containsKey(String url) {
196196
return getFromCache(url) != null;
197197
}
198198

199+
/**
200+
* whether the element of the specified url has invalided
201+
*
202+
* @param url
203+
* @return true if the element of the specified url has invalided, false otherwise.
204+
*/
205+
protected boolean isExpired(String url) {
206+
return getFromCache(url) == null;
207+
}
208+
199209
/**
200210
* Removes all elements from this cache, leaving it empty.
201211
*/

src/cn/trinea/android/common/util/MapUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class MapUtils {
2626
* isEmpty({1, 2}) = false;
2727
* </pre>
2828
*
29-
* @param str
29+
* @param sourceMap
3030
* @return if map is null or its size is 0, return true, else return false.
3131
*/
3232
public static <K, V> boolean isEmpty(Map<K, V> sourceMap) {

0 commit comments

Comments
 (0)