@Test public void testIsValid() throws Exception { Cache cache = getTestCache(); CacheEntry entry = new JCacheEntry(new Element("key1", "value1")); assertEquals(true, entry.isValid()); cache.put(entry.getKey(), entry.getValue()); CacheEntry retrievedEntry = cache.getCacheEntry(entry.getKey()); assertEquals(true, retrievedEntry.isValid()); Thread.sleep(1020); assertEquals(false, retrievedEntry.isValid()); }
public boolean isValid() { if (element != null) { return !element.isExpired(); } else { return false; } }
JCacheEntry implements CacheEntry { public boolean isValid() { if (element != null) { return !element.isExpired(); } else { return false; } } }
JCacheEntry implements CacheEntry { public boolean isValid() { if (element != null) { return !element.isExpired(); } else { return false; } } JCacheEntry(Element element); }
JCacheEntry implements CacheEntry { public boolean isValid() { if (element != null) { return !element.isExpired(); } else { return false; } } JCacheEntry(Element element); Object getKey(); Object getValue(); Object setValue(Object value); long getCost(); long getCreationTime(); long getExpirationTime(); int getHits(); long getLastAccessTime(); long getLastUpdateTime(); long getVersion(); boolean isValid(); }
JCacheEntry implements CacheEntry { public boolean isValid() { if (element != null) { return !element.isExpired(); } else { return false; } } JCacheEntry(Element element); Object getKey(); Object getValue(); Object setValue(Object value); long getCost(); long getCreationTime(); long getExpirationTime(); int getHits(); long getLastAccessTime(); long getLastUpdateTime(); long getVersion(); boolean isValid();  }