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 long
createdAt_
private java.lang.String
key_
private long
lastAccess_
private WebResponse
response_
private java.lang.Object
value_
-
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 int
compareTo(Cache.Entry other)
boolean
equals(java.lang.Object obj)
int
hashCode()
(package private) boolean
isStillFresh(long now)
Is this cached entry still fresh?void
touch()
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:
compareTo
in interfacejava.lang.Comparable<Cache.Entry>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
true
if can keep in the cache- See Also:
Cache.isWithinCacheWindow(WebResponse, long, long)
-
-