@Test public void testPutAll() { Ehcache ehcache = new net.sf.ehcache.Cache("testPutAll", 2, true, true, 500, 200); manager.addCache(ehcache); Cache cache = new JCache(ehcache); assertTrue(cache.isEmpty()); cache.putAll(null); assertTrue(cache.isEmpty()); cache.putAll(new HashMap()); assertTrue(cache.isEmpty()); Map map = new HashMap(); for (int i = 0; i < 10; i++) { map.put(i + "", new Date()); } cache.putAll(map); assertEquals(10, cache.size()); }
public void putAll(Map sourceMap) { if (sourceMap == null) { return; } for (Iterator iterator = sourceMap.keySet().iterator(); iterator.hasNext();) { Object key = iterator.next(); cache.put(new Element(key, sourceMap.get(key))); } }
JCache implements net.sf.jsr107cache.Cache { public void putAll(Map sourceMap) { if (sourceMap == null) { return; } for (Iterator iterator = sourceMap.keySet().iterator(); iterator.hasNext();) { Object key = iterator.next(); cache.put(new Element(key, sourceMap.get(key))); } } }
JCache implements net.sf.jsr107cache.Cache { public void putAll(Map sourceMap) { if (sourceMap == null) { return; } for (Iterator iterator = sourceMap.keySet().iterator(); iterator.hasNext();) { Object key = iterator.next(); cache.put(new Element(key, sourceMap.get(key))); } } JCache(Ehcache cache);  JCache(Ehcache cache, net.sf.jsr107cache.CacheLoader cacheLoader);  JCache(Ehcache cache, JCacheLoader cacheLoader); }
JCache implements net.sf.jsr107cache.Cache { public void putAll(Map sourceMap) { if (sourceMap == null) { return; } for (Iterator iterator = sourceMap.keySet().iterator(); iterator.hasNext();) { Object key = iterator.next(); cache.put(new Element(key, sourceMap.get(key))); } } JCache(Ehcache cache);  JCache(Ehcache cache, net.sf.jsr107cache.CacheLoader cacheLoader);  JCache(Ehcache cache, JCacheLoader cacheLoader); void setCacheLoader(JCacheLoader cacheLoader); void addListener(CacheListener cacheListener); void evict(); Map getAll(Collection keys); Map getAll(Collection keys, Object loaderArgument); CacheLoader getCacheLoader(); CacheEntry getCacheEntry(Object key); CacheStatistics getCacheStatistics(); void load(final Object key); void loadAll(final Collection keys); void loadAll(final Collection keys, final Object loaderArgument); Object peek(Object key); void removeListener(CacheListener cacheListener); int size(); boolean isEmpty(); boolean containsKey(Object key); boolean containsValue(Object value); Object get(Object key); Object get(Object key, Object loaderArgument); Object get(Object key, JCacheLoader loader); Object get(Object key, JCacheLoader loader, Object loaderArgument); Object put(Object key, Object value); Object put(Object key, Object value, int timeToLiveSeconds); Object remove(Object key); void putAll(Map sourceMap); void clear(); Set keySet(); Collection values(); Set entrySet(); void setStatisticsAccuracy(int statisticsAccuracy); Ehcache getBackingCache(); String toString(); }
JCache implements net.sf.jsr107cache.Cache { public void putAll(Map sourceMap) { if (sourceMap == null) { return; } for (Iterator iterator = sourceMap.keySet().iterator(); iterator.hasNext();) { Object key = iterator.next(); cache.put(new Element(key, sourceMap.get(key))); } } JCache(Ehcache cache);  JCache(Ehcache cache, net.sf.jsr107cache.CacheLoader cacheLoader);  JCache(Ehcache cache, JCacheLoader cacheLoader); void setCacheLoader(JCacheLoader cacheLoader); void addListener(CacheListener cacheListener); void evict(); Map getAll(Collection keys); Map getAll(Collection keys, Object loaderArgument); CacheLoader getCacheLoader(); CacheEntry getCacheEntry(Object key); CacheStatistics getCacheStatistics(); void load(final Object key); void loadAll(final Collection keys); void loadAll(final Collection keys, final Object loaderArgument); Object peek(Object key); void removeListener(CacheListener cacheListener); int size(); boolean isEmpty(); boolean containsKey(Object key); boolean containsValue(Object value); Object get(Object key); Object get(Object key, Object loaderArgument); Object get(Object key, JCacheLoader loader); Object get(Object key, JCacheLoader loader, Object loaderArgument); Object put(Object key, Object value); Object put(Object key, Object value, int timeToLiveSeconds); Object remove(Object key); void putAll(Map sourceMap); void clear(); Set keySet(); Collection values(); Set entrySet(); void setStatisticsAccuracy(int statisticsAccuracy); Ehcache getBackingCache(); String toString();  }