Skip to content

Method: statement(Statement)

1: package cz.cvut.kbss.ontodriver.owlapi.query;
2:
3: import cz.cvut.kbss.ontodriver.Statement;
4:
5: import java.util.Objects;
6:
7: class QuerySpecification {
8:
9: private final String query;
10:
11: private Statement statement;
12:
13: private boolean disableInference = false;
14:
15: private QuerySpecification(String query) {
16: this.query = query;
17: }
18:
19: public String getQuery() {
20: return query;
21: }
22:
23: public Statement getStatement() {
24: return statement;
25: }
26:
27: public boolean isDisableInference() {
28: return disableInference;
29: }
30:
31: public QuerySpecification statement(Statement statement) {
32: this.statement = statement;
33: return this;
34: }
35:
36: public QuerySpecification disableInference(boolean disableInference) {
37: this.disableInference = disableInference;
38: return this;
39: }
40:
41: public static QuerySpecification query(String query) {
42: return new QuerySpecification(query);
43: }
44:
45: @Override
46: public boolean equals(Object o) {
47: if (this == o) {
48: return true;
49: }
50: if (o == null || getClass() != o.getClass()) {
51: return false;
52: }
53: QuerySpecification that = (QuerySpecification) o;
54: return disableInference == that.disableInference && query.equals(that.query);
55: }
56:
57: @Override
58: public int hashCode() {
59: return Objects.hash(query, disableInference);
60: }
61: }