Be more flexible: follow the "PECS" rule for our Function.
This commit is contained in:
@@ -34,7 +34,7 @@ public class XArrayList<T> extends ArrayList<T>
|
||||
implements XList<T>
|
||||
{
|
||||
// from interface XList<T>
|
||||
public <R> Collection<R> map (Function<T, R> mapper)
|
||||
public <R> Collection<R> map (Function<? super T, ? extends R> mapper)
|
||||
{
|
||||
return Lists.transform(this, mapper);
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@ public interface XList<T> extends List<T>
|
||||
* Collection} to remind the caller that it is not an {@link ArrayList} but rather a lazy list
|
||||
* that will call the mapping function on the fly each time an element is read. Caveat coder.
|
||||
*/
|
||||
public <R> Collection<R> map (Function<T, R> mapper);
|
||||
public <R> Collection<R> map (Function<? super T, ? extends R> mapper);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user