Package org.htmlunit
Class Cache.Entry
- java.lang.Object
-
- org.htmlunit.Cache.Entry
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Cache.Entry>
- Enclosing class:
- Cache
private static class Cache.Entry extends java.lang.Object implements java.lang.Comparable<Cache.Entry>, java.io.Serializable
A cache entry.
-
-
Field Summary
Fields Modifier and Type Field Description private longcreatedAt_private java.lang.Stringkey_private longlastAccess_private WebResponseresponse_private java.lang.Objectvalue_
-
Constructor Summary
Constructors Constructor Description Entry(java.lang.String key, WebResponse response, java.lang.Object value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Cache.Entry other)booleanequals(java.lang.Object obj)inthashCode()(package private) booleanisStillFresh(long now)Is this cached entry still fresh?voidtouch()Updates the last access date.
-
-
-
Field Detail
-
key_
private final java.lang.String key_
-
response_
private final WebResponse response_
-
value_
private final java.lang.Object value_
-
lastAccess_
private long lastAccess_
-
createdAt_
private final long createdAt_
-
-
Constructor Detail
-
Entry
Entry(java.lang.String key, WebResponse response, java.lang.Object value)
-
-
Method Detail
-
compareTo
public int compareTo(Cache.Entry other)
- Specified by:
compareToin interfacejava.lang.Comparable<Cache.Entry>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
touch
public void touch()
Updates the last access date.
-
isStillFresh
boolean isStillFresh(long now)
Is this cached entry still fresh?- Parameters:
now- the current time- Returns:
trueif can keep in the cache- See Also:
Cache.isWithinCacheWindow(WebResponse, long, long)
-
-