Package com.zendesk.sdk.util
Class ScopeCache<T>
- java.lang.Object
-
- com.zendesk.sdk.util.ScopeCache<T>
-
- Type Parameters:
T
- Type of the cached dependency.
public class ScopeCache<T> extends java.lang.Object
Class for caching dependencies in a scope.
-
-
Constructor Summary
Constructors Constructor and Description ScopeCache()
Constructor for instantiating aScopeCache
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description T
get(DependencyProvider<? extends T> provider)
Retrieve the cached dependency.
-
-
-
Constructor Detail
-
ScopeCache
public ScopeCache()
Constructor for instantiating aScopeCache
-
-
Method Detail
-
get
public T get(DependencyProvider<? extends T> provider)
Retrieve the cached dependency.
If the dependency was already requested before, no new object will be created. On the first call the providedDependencyProvider
will be called to create an instance of the dependency.- Parameters:
provider
-DependencyProvider
for initially creating the dependency.- Returns:
- the requested dependency
-
-