public class HashMapCache extends Object
MemoryCache stores entries in a ConcurrentMap.| Constructor and Description |
|---|
HashMapCache() |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.collect.ImmutableMap<UUID,Profile> |
getAllPresent(Iterable<UUID> uuids)
Query the cache for the names of the given UUIDs.
|
Profile |
getIfPresent(UUID uuid)
Query the cache for the name for a given UUID.
|
void |
put(Profile profile)
Store the given name as the last known name for the given UUID.
|
void |
putAll(Iterable<Profile> profiles)
Store a list of zero or more names.
|
public void putAll(Iterable<Profile> profiles)
ProfileCacheIf the operation fails, an error will be logged but no exception will be thrown.
profiles - an iterable of profilespublic com.google.common.collect.ImmutableMap<UUID,Profile> getAllPresent(Iterable<UUID> uuids)
ProfileCacheIf the operation fails, an error will be logged but no exception will be thrown.
uuids - a list of UUIDs to querypublic void put(Profile profile)
ProfileCacheIf the operation fails, an error will be logged but no exception will be thrown.
put in interface ProfileCacheprofile - a profile@Nullable public Profile getIfPresent(UUID uuid)
ProfileCacheIf the operation fails, an error will be logged but no exception will be thrown.
getIfPresent in interface ProfileCacheuuid - the UUIDnull if it is not knownCopyright © 2014. All Rights Reserved.