public class ResponseMetadataCache extends Object implements MetadataCache
Constructor and Description |
---|
ResponseMetadataCache(int maxEntries)
Creates a new cache that will contain, at most the specified number of
entries.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Object obj,
ResponseMetadata metadata)
Adds a new entry to this cache, possibly evicting the oldest entry if the
cache is at its size limit.
|
ResponseMetadata |
get(Object obj)
Returns the response metadata associated with the specified object, or
null if no metadata is associated with that object.
|
public ResponseMetadataCache(int maxEntries)
maxEntries
- The maximum size of this cache.public void add(Object obj, ResponseMetadata metadata)
MetadataCache
add
in interface MetadataCache
obj
- The key by which to store the metadata.metadata
- The metadata for this entry.public ResponseMetadata get(Object obj)
MetadataCache
get
in interface MetadataCache
obj
- The key by which the desired metadata is stored.Copyright © 2024. All rights reserved.