Ignore:
Timestamp:
2016-07-27T02:08:34+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390, see #12890 - use Java 8 Predicates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10638 r10657  
    102102     * Tests whether {@code predicate} applies to at least one element from {@code collection}.
    103103     * <p>
    104      * Note: you can use {@link Stream#anyMatch(java.util.function.Predicate)} instead.
    105104     * @param <T> type of items
    106105     * @param collection the collection
    107106     * @param predicate the predicate
    108107     * @return {@code true} if {@code predicate} applies to at least one element from {@code collection}
    109      */
     108     * @deprecated use {@link Stream#anyMatch(java.util.function.Predicate)} instead.
     109     */
     110    @Deprecated
    110111    public static <T> boolean exists(Iterable<? extends T> collection, Predicate<? super T> predicate) {
    111112        for (T item : collection) {
     
    120121     * Tests whether {@code predicate} applies to all elements from {@code collection}.
    121122     * <p>
    122      * Note: you can use {@link Stream#allMatch(java.util.function.Predicate)} instead.
    123123     * @param <T> type of items
    124124     * @param collection the collection
    125125     * @param predicate the predicate
    126126     * @return {@code true} if {@code predicate} applies to all elements from {@code collection}
    127      */
     127     * @deprecated use {@link Stream#allMatch(java.util.function.Predicate)} instead.
     128     */
     129    @Deprecated
    128130    public static <T> boolean forAll(Iterable<? extends T> collection, Predicate<? super T> predicate) {
    129131        return !exists(collection, Predicates.not(predicate));
Note: See TracChangeset for help on using the changeset viewer.