mirror of
https://github.com/apache/commons-collections.git
synced 2025-03-03 07:19:21 +00:00
Change to InstanceofPredicate to avoid indirect references via PredicateUtils
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131705 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f95139faac
commit
9f99282555
@ -17,7 +17,7 @@ package org.apache.commons.collections.map;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.collections.PredicateUtils;
|
import org.apache.commons.collections.functors.InstanceofPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>Map</code> to validate that elements added
|
* Decorates another <code>Map</code> to validate that elements added
|
||||||
@ -30,7 +30,7 @@ import org.apache.commons.collections.PredicateUtils;
|
|||||||
* The returned implementation is Serializable from Commons Collections 3.1.
|
* The returned implementation is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/04/09 14:57:10 $
|
* @version $Revision: 1.6 $ $Date: 2004/05/07 23:17:13 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Matthew Hawthorne
|
* @author Matthew Hawthorne
|
||||||
@ -52,8 +52,8 @@ public class TypedMap {
|
|||||||
public static Map decorate(Map map, Class keyType, Class valueType) {
|
public static Map decorate(Map map, Class keyType, Class valueType) {
|
||||||
return new PredicatedMap(
|
return new PredicatedMap(
|
||||||
map,
|
map,
|
||||||
PredicateUtils.instanceofPredicate(keyType),
|
InstanceofPredicate.getInstance(keyType),
|
||||||
PredicateUtils.instanceofPredicate(valueType)
|
InstanceofPredicate.getInstance(valueType)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ package org.apache.commons.collections.map;
|
|||||||
|
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
|
||||||
import org.apache.commons.collections.PredicateUtils;
|
import org.apache.commons.collections.functors.InstanceofPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>SortedMap</code> to validate that elements added
|
* Decorates another <code>SortedMap</code> to validate that elements added
|
||||||
@ -30,7 +30,7 @@ import org.apache.commons.collections.PredicateUtils;
|
|||||||
* The returned implementation is Serializable from Commons Collections 3.1.
|
* The returned implementation is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/04/09 14:57:10 $
|
* @version $Revision: 1.6 $ $Date: 2004/05/07 23:18:26 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Matthew Hawthorne
|
* @author Matthew Hawthorne
|
||||||
@ -52,8 +52,8 @@ public class TypedSortedMap {
|
|||||||
public static SortedMap decorate(SortedMap map, Class keyType, Class valueType) {
|
public static SortedMap decorate(SortedMap map, Class keyType, Class valueType) {
|
||||||
return new PredicatedSortedMap(
|
return new PredicatedSortedMap(
|
||||||
map,
|
map,
|
||||||
PredicateUtils.instanceofPredicate(keyType),
|
InstanceofPredicate.getInstance(keyType),
|
||||||
PredicateUtils.instanceofPredicate(valueType)
|
InstanceofPredicate.getInstance(valueType)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user