public abstract class AbstractObjectCache extends Object implements ObjectCache
Cache
instance and provide theModifier and Type | Class and Description |
---|---|
protected static class |
AbstractObjectCache.SoftKey<T>
Key used in the underlying map.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractObjectCache(com.google.common.cache.Cache<AbstractObjectCache.SoftKey<?>,Object> cache,
com.google.common.base.FinalizableReferenceQueue queue) |
Modifier and Type | Method and Description |
---|---|
protected <T> AbstractObjectCache.SoftKey<T> |
createSoftKey(T object) |
<B extends ProductAwareBuilder<P>,P> |
getProduct(B builder)
Get a reference to an object equal to the product of a builder.
|
<T> T |
getReference(T object)
Get a reference for an object which is equal to specified object.
|
protected AbstractObjectCache(com.google.common.cache.Cache<AbstractObjectCache.SoftKey<?>,Object> cache, com.google.common.base.FinalizableReferenceQueue queue)
protected <T> AbstractObjectCache.SoftKey<T> createSoftKey(T object)
public final <B extends ProductAwareBuilder<P>,P> P getProduct(B builder)
ObjectCache
ObjectCache.getReference(Object)
, this method has
the potential of completely eliding the product instantiation.getProduct
in interface ObjectCache
B
- builder typeP
- produced object typebuilder
- Builder instance, may not be nullpublic final <T> T getReference(T object)
ObjectCache
getReference
in interface ObjectCache
T
- object typeobject
- Requested object, may be nullCopyright © 2017 OpenDaylight. All rights reserved.