@ThreadSafe public final class HashMapCache extends Object implements LevelUpCodeCache
Constructor and Description |
---|
HashMapCache() |
Modifier and Type | Method and Description |
---|---|
LevelUpQrCodeGenerator.LevelUpQrCodeImage |
getCode(String key) |
boolean |
hasCode(String key) |
void |
putCode(String key,
LevelUpQrCodeGenerator.LevelUpQrCodeImage image) |
public void putCode(String key, LevelUpQrCodeGenerator.LevelUpQrCodeImage image)
putCode
in interface LevelUpCodeCache
key
- the key under which to store the code. This should be unique for each code.image
- the code image. This should be the smallest-possible code image.public LevelUpQrCodeGenerator.LevelUpQrCodeImage getCode(String key)
getCode
in interface LevelUpCodeCache
key
- the key under which the image is stored.null
if there is no entry.public boolean hasCode(String key)
hasCode
in interface LevelUpCodeCache
key
- the key under which the image is stored.