T - the type to be cached, typically either IPAddressString or HostNamepublic abstract static class AddressNetwork.HostIdentifierStringGenerator<T extends HostIdentifierString> extends Object implements Serializable
You choose the map of your choice to be the backing map for the cache. For example, for thread-safe access to the cache, ConcurrentHashMap is a good choice. For maps of bounded size, LinkedHashMap provides the removeEldestEntry method to override to implement LRU or other eviction mechanisms.
| Constructor and Description |
|---|
HostIdentifierStringGenerator() |
HostIdentifierStringGenerator(Map<String,T> backingMap) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(T value)
Returns whether the given instance is in the cache.
|
abstract T |
get(Address.AddressValueProvider addressProvider) |
abstract T |
get(byte[] bytes) |
T |
get(String key)
Gets the object for the given key.
|
Map<String,T> |
getBackingMap() |
public boolean contains(T value)
value - public T get(String key)
key - public abstract T get(byte[] bytes)
public abstract T get(Address.AddressValueProvider addressProvider)