blob: 8b4c695066a9de862bf065d9439567b827691e59 [file] [log] [blame]
David Jencksbae44842014-06-21 20:15:24 +00001/*
2 * Copyright (c) OSGi Alliance (2014). All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.osgi.util.function;
18
19import org.osgi.annotation.versioning.ConsumerType;
20
21/**
22 * A predicate that accepts a single argument and produces a boolean result.
23 *
24 * <p>
25 * This is a functional interface and can be used as the assignment target for a
26 * lambda expression or method reference.
27 *
28 * @param <T> The type of the predicate input.
29 *
30 * @ThreadSafe
31 * @author $Id: 0c2c61f78bede4e2afc4278af4f5e4b873769347 $
32 */
33@ConsumerType
34public interface Predicate<T> {
35 /**
36 * Evaluates this predicate on the specified argument.
37 *
38 * @param t The input to this predicate.
39 * @return {@code true} if the specified argument is accepted by this
40 * predicate; {@code false} otherwise.
41 */
42 boolean test(T t);
43}