|
2 weeks ago | |
---|---|---|
src | 2 weeks ago | |
.gitignore | 2 years ago | |
README.md | 2 weeks ago | |
pom.xml | 2 weeks ago |
A simple java helper library for managing a cache of objects.
Include the library in your project by adding the following dependency to your pom.xml
<dependency>
<groupId>com.mclarkdev.tools</groupId>
<artifactId>libobjectcache</artifactId>
<version>1.5.1</version>
</dependency>
To create custom Cached Objects, simply extend the LibObjectCacheCachedObject class.
// Add object to the cache
LibObjectCache.getCache("objects").put("obj-1", new MyCachedObject());
// Recall from cache later
MyCachedObject o = LibObjectCache.getCache("objects").get("obj-1");
// Object details
o.isExpired();
o.getTouchCount();
o.getTimeCreated();
o.getTimeExpires();
Open source & free for all. ❤