Package: PendingAssertion
PendingAssertion
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PendingAssertion(NamedResource, Assertion, URI) |
|
|
|
|
|
||||||||||||||||||||
equals(Object) |
|
|
|
|
|
||||||||||||||||||||
getAssertion() |
|
|
|
|
|
||||||||||||||||||||
getContext() |
|
|
|
|
|
||||||||||||||||||||
getOwner() |
|
|
|
|
|
||||||||||||||||||||
hashCode() |
|
|
|
|
|
||||||||||||||||||||
toString() |
|
|
|
|
|
Coverage
1: /**
2: * Copyright (C) 2016 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: package cz.cvut.kbss.jopa.oom;
16:
17: import cz.cvut.kbss.ontodriver.model.Assertion;
18: import cz.cvut.kbss.ontodriver.model.NamedResource;
19:
20: import java.net.URI;
21:
22: /**
23: * Pending assertion represents reference to an instance which has not been persisted, yet.
24: */
25: class PendingAssertion {
26: private final NamedResource owner;
27: private final Assertion assertion;
28: private final URI context;
29:
30:
31: PendingAssertion(NamedResource owner, Assertion assertion, URI context) {
32: this.owner = owner;
33: this.assertion = assertion;
34: this.context = context;
35: }
36:
37: public NamedResource getOwner() {
38: return owner;
39: }
40:
41: public Assertion getAssertion() {
42: return assertion;
43: }
44:
45: public URI getContext() {
46: return context;
47: }
48:
49: @Override
50: public boolean equals(Object o) {
51:• if (this == o) return true;
52:• if (o == null || getClass() != o.getClass()) return false;
53:
54: PendingAssertion that = (PendingAssertion) o;
55:
56:• return owner.equals(that.owner) && assertion.equals(that.assertion) && (context != null ?
57:• context.equals(that.context) : that.context == null);
58: }
59:
60: @Override
61: public int hashCode() {
62: int result = owner.hashCode();
63: result = 31 * result + assertion.hashCode();
64:• result = 31 * result + (context != null ? context.hashCode() : 0);
65: return result;
66: }
67:
68: @Override
69: public String toString() {
70: return "PendingAssertion{" +
71: owner + " -> " + assertion +
72: ", context=" + context +
73: '}';
74: }
75: }