Skip to content

Package: PendingAssertion

PendingAssertion

nameinstructionbranchcomplexitylinemethod
PendingAssertion(NamedResource, Assertion, URI)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
equals(Object)
M: 39 C: 0
0%
M: 12 C: 0
0%
M: 7 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getAssertion()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getContext()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getOwner()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
hashCode()
M: 0 C: 27
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
toString()
M: 22 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (C) 2020 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: import java.util.Objects;
22:
23: /**
24: * Pending assertion represents reference to an instance which has not been persisted, yet.
25: */
26: class PendingAssertion {
27: private final NamedResource owner;
28: private final Assertion assertion;
29: private final URI context;
30:
31:
32: PendingAssertion(NamedResource owner, Assertion assertion, URI context) {
33: this.owner = owner;
34: this.assertion = assertion;
35: this.context = context;
36: }
37:
38: public NamedResource getOwner() {
39: return owner;
40: }
41:
42: public Assertion getAssertion() {
43: return assertion;
44: }
45:
46: public URI getContext() {
47: return context;
48: }
49:
50: @Override
51: public boolean equals(Object o) {
52:• if (this == o) return true;
53:• if (o == null || getClass() != o.getClass()) return false;
54:
55: PendingAssertion that = (PendingAssertion) o;
56:
57:• return owner.equals(that.owner) && assertion.equals(that.assertion) && (Objects.equals(context, that.context));
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: }