Skip to content

Package: AndPredicate

AndPredicate

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.model.query.predicate;
14:
15: import javax.validation.constraints.NotNull;
16: import java.util.List;
17:
18: /**
19: * {@link AndPredicate} definition.
20: * <p>
21: * Used to link multiple {@link QueryPredicate}s in AND clause.
22: *
23: * @since 1.0.0
24: */
25: public interface AndPredicate extends QueryPredicate {
26:
27: /**
28: * Adds the given {@link QueryPredicate} to the {@link AndPredicate}.
29: *
30: * @param predicate The {@link AndPredicate} to concatenate
31: * @return {@code this} {@link AndPredicate}.
32: * @throws NullPointerException if the given parameter is {@code null}.
33: * @since 1.0.0
34: */
35: AndPredicate and(@NotNull QueryPredicate predicate);
36:
37: /**
38: * Gets all {@link QueryPredicate} set for this {@link AndPredicate}
39: *
40: * @return The {@link List} of {@link QueryPredicate}s
41: * @since 1.0.0
42: */
43: List<QueryPredicate> getPredicates();
44:
45: /**
46: * Sets a {@link List} of {@link QueryPredicate}s in AND clause
47: *
48: * @param predicates The {@link List} of {@link QueryPredicate}s
49: * @throws NullPointerException if the given parameter is {@code null}.
50: * @since 1.1.0
51: */
52: void setPredicates(@NotNull List<QueryPredicate> predicates);
53: }