replace filter with predicate

This commit is contained in:
Sebastian Sdorra
2014-01-09 20:16:03 +01:00
parent 908f2fe6c8
commit 4f6460eeae
10 changed files with 48 additions and 110 deletions

View File

@@ -30,14 +30,14 @@
*/
package sonia.scm.cache;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.base.Predicate;
import com.google.common.collect.Maps;
import sonia.scm.Filter;
//~--- JDK imports ------------------------------------------------------------
import java.util.Map;
@@ -113,13 +113,13 @@ public class MapCache<K, V> implements Cache<K, V>
* @return
*/
@Override
public boolean removeAll(Filter<K> filter)
public boolean removeAll(Predicate<K> filter)
{
boolean result = false;
for (K key : map.keySet())
{
if (filter.accept(key))
if (filter.apply(key))
{
if (remove(key))
{
@@ -150,5 +150,5 @@ public class MapCache<K, V> implements Cache<K, V>
//~--- fields ---------------------------------------------------------------
/** Field description */
private Map<K, V> map = Maps.newHashMap();
private final Map<K, V> map = Maps.newHashMap();
}