public static class DocumentCache.Entry extends Object
This class is thread-safe.
Modifier and Type | Field and Description |
---|---|
Document |
document
The cached document.
|
File |
file
If
url is a "file:" URL, this field contains
the corresponding file. |
long |
lastModified
The last modification date of the cached document.
|
int |
loadOptions
A OR-ed mask containing the
LoadOptions that were
used to load the cached document. |
long |
size
The size in bytes of the cached document.
|
URL |
url
The location of the cached document.
|
Constructor and Description |
---|
Entry(URL url,
Document document,
int loadOptions,
File file,
long lastModified,
long size)
Constructs a fully initialized cache entry.
|
Modifier and Type | Method and Description |
---|---|
Object |
addProperty(Object key,
Supplier<Object> value)
Returns the value of specified property if it already exists;
creates it and adds it before returning it otherwise.
|
Object |
getProperty(Object key)
Returns the value of specified property.
|
Object |
setProperty(Object key,
Object value)
Adds, replaces or remove a property.
|
String |
toString()
Returns a string representation of this entry which is suitable
for debugging and testing.
|
public final URL url
public final Document document
public final int loadOptions
LoadOptions
that were
used to load the cached document.public final File file
url
is a "file:" URL, this field contains
the corresponding file. Hence, this field may be null
.public final long lastModified
public final long size
public String toString()
public Object getProperty(Object key)
key
- the property namenull
otherwise.public Object setProperty(Object key, Object value)
key
- the property namevalue
- the property value; specify null
to remove the propertynull
if property has been addedpublic Object addProperty(Object key, Supplier<Object> value)
key
- the property namevalue
- specifies how to create the property value