Skip to content

Package: AxiomImpl

AxiomImpl

nameinstructionbranchcomplexitylinemethod
AxiomImpl(NamedResource, Assertion, Value)
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
equals(Object)
M: 4 C: 35
90%
M: 4 C: 8
67%
M: 4 C: 3
43%
M: 2 C: 4
67%
M: 0 C: 1
100%
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%
getSubject()
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%
getValue()
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: 19
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 0 C: 22
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2022 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.ontodriver.model;
16:
17: import java.util.Objects;
18:
19: public final class AxiomImpl<T> implements Axiom<T> {
20:
21: private final NamedResource subject;
22: private final Assertion assertion;
23: private final Value<T> value;
24:
25: public AxiomImpl(NamedResource subject, Assertion assertion, Value<T> value) {
26: this.subject = Objects.requireNonNull(subject);
27: this.assertion = Objects.requireNonNull(assertion);
28: this.value = Objects.requireNonNull(value);
29: }
30:
31: @Override
32: public NamedResource getSubject() {
33: return subject;
34: }
35:
36: @Override
37: public Assertion getAssertion() {
38: return assertion;
39: }
40:
41: @Override
42: public Value<T> getValue() {
43: return value;
44: }
45:
46: @Override
47: public boolean equals(Object o) {
48:• if (this == o) {
49: return true;
50: }
51:• if (o == null || getClass() != o.getClass()) {
52: return false;
53: }
54: AxiomImpl<?> axiom = (AxiomImpl<?>) o;
55:• return subject.equals(axiom.subject) && assertion.equals(axiom.assertion) && value.equals(axiom.value);
56: }
57:
58: @Override
59: public int hashCode() {
60: return Objects.hash(subject, assertion, value);
61: }
62:
63: @Override
64: public String toString() {
65: return "[" + subject + " " + assertion + " " + value + "]";
66: }
67: }