T
- the type to be cached, typically either IPAddressString or HostNamepublic abstract static class AddressNetwork.HostIdentifierStringGenerator<T extends HostIdentifierString>
extends java.lang.Object
implements java.io.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(java.util.Map<java.lang.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(java.lang.String key)
Gets the object for the given key.
|
java.util.Map<java.lang.String,T> |
getBackingMap() |
public HostIdentifierStringGenerator()
public HostIdentifierStringGenerator(java.util.Map<java.lang.String,T> backingMap)
public java.util.Map<java.lang.String,T> getBackingMap()
public boolean contains(T value)
value
- public T get(java.lang.String key)
key
- public abstract T get(byte[] bytes)
public abstract T get(Address.AddressValueProvider addressProvider)