Skip to content

Package: Predicate$BooleanOperator

Predicate$BooleanOperator

nameinstructionbranchcomplexitylinemethod
static {...}
M: 0 C: 24
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2011 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15:
16: package cz.cvut.kbss.jopa.model.query.criteria;
17:
18: import java.util.List;
19:
20: /**
21: * The type of a simple or compound predicate: a conjunction or disjunction of
22: * restrictions. A simple predicate is considered to be a conjunction with a
23: * single conjunct.
24: */
25: public interface Predicate extends Expression<Boolean> {
26:         public static enum BooleanOperator {
27:                 AND, OR
28:         }
29:
30:         /**
31:          * Return the boolean operator for the predicate. If the predicate is
32:          * simple, this is AND.
33:          *
34:          * @return boolean operator for the predicate
35:          */
36:         BooleanOperator getOperator();
37:
38:         /**
39:          * Whether the predicate has been created from another predicate by applying
40:          * the Predicate not() method or the CriteriaBuilder not() method.
41:          *
42:          * @return boolean indicating if the predicate is
43:          *
44:          * a negated predicate
45:          */
46:         boolean isNegated();
47:
48:         /**
49:          * Return the top-level conjuncts or disjuncts of the predicate. Returns
50:          * empty list if there are no top-level conjuncts or disjuncts of the
51:          * predicate. Modifications to the list do not affect the query.
52:          *
53:          * @return list of boolean expressions forming the predicate
54:          */
55:         List<Expression<Boolean>> getExpressions();
56:
57:         /**
58:          * Create a negation of the predicate.
59:          *
60:          * @return negated predicate
61:          */
62:         Predicate not();
63: }