source: josm/trunk/src/org/openstreetmap/josm/tools/Predicate.java@ 10621

Last change on this file since 10621 was 10582, checked in by Don-vip, 8 years ago

see #11390, fix #12908 - Java 8: Move to java Predicates (patch by michael2402) - gsoc-core

  • Property svn:eol-style set to native
File size: 729 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4/**
5 * Used to identify objects that fulfill a certain condition, e.g. when filtering a collection.
6 *
7 * @param <T> The objects type
8 * @since 3177
9 * @deprecated Use {@link java.util.function.Predicate} instead.
10 */
11@Deprecated
12@FunctionalInterface
13public interface Predicate<T> extends java.util.function.Predicate<T> {
14
15 /**
16 * Determines whether the object passes the test or not
17 * @param object The object to evaluate
18 * @return {@code true} if the object passes the test, {@code false} otherwise
19 */
20 boolean evaluate(T object);
21
22 @Override
23 default boolean test(T t) {
24 return evaluate(t);
25 }
26}
Note: See TracBrowser for help on using the repository browser.