public interface BuilderCache
Modifier and Type | Method and Description |
---|---|
java.io.Serializable |
getCachedItem(java.lang.String key)
Get a cached item.
|
void |
maybeCacheItem(java.lang.String key,
java.io.Serializable item)
This method may be called when an item is built, providing an opportunity to
cache it.
|
java.io.Serializable getCachedItem(java.lang.String key)
key
- The key used to identify the item. The key uniquely identifies all
of the source information that will go into building the item if this call fails
to retrieve a cached version. Typically this will be a cryptographic hash of
the serialized form of that information.void maybeCacheItem(java.lang.String key, java.io.Serializable item)
key
- The key that will be used to identify the item in future calls to getCachedItem(String)
.
Only letters, digits, and underscores are valid in keys, and key length is limited to 32 characters.
The behaviour of this method for invalid keys is undefined.
Keys that differ only by case may or may not be considered equal by this class.
item
- The item to cache, if desired