aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-query/src/main/java/tools/refinery/store/query/term/bool/BoolTerms.java
blob: 3d6c8d9d55dc39881310b8a23e01b2162d83dfbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package tools.refinery.store.query.term.bool;

import tools.refinery.store.query.term.ConstantTerm;
import tools.refinery.store.query.term.Term;

public final class BoolTerms {
	private BoolTerms() {
		throw new IllegalArgumentException("This is a static utility class and should not be instantiated directly");
	}

	public static ConstantTerm<Boolean> constant(boolean value) {
		return BoolConstantTerm.valueOf(value);
	}

	public static BoolNotTerm not(Term<Boolean> body) {
		return new BoolNotTerm(body);
	}

	public static BoolLogicBinaryTerm and(Term<Boolean> left, Term<Boolean> right) {
		return new BoolLogicBinaryTerm(LogicBinaryOperator.AND, left, right);
	}

	public static BoolLogicBinaryTerm or(Term<Boolean> left, Term<Boolean> right) {
		return new BoolLogicBinaryTerm(LogicBinaryOperator.OR, left, right);
	}

	public static BoolLogicBinaryTerm xor(Term<Boolean> left, Term<Boolean> right) {
		return new BoolLogicBinaryTerm(LogicBinaryOperator.XOR, left, right);
	}
}