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: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * JOPA
3: * Copyright (C) 2024 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.ontodriver.model;
19:
20: import java.util.Objects;
21:
22: public final class AxiomImpl<T> implements Axiom<T> {
23:
24: private final NamedResource subject;
25: private final Assertion assertion;
26: private final Value<T> value;
27:
28: public AxiomImpl(NamedResource subject, Assertion assertion, Value<T> value) {
29: this.subject = Objects.requireNonNull(subject);
30: this.assertion = Objects.requireNonNull(assertion);
31: this.value = Objects.requireNonNull(value);
32: }
33:
34: @Override
35: public NamedResource getSubject() {
36: return subject;
37: }
38:
39: @Override
40: public Assertion getAssertion() {
41: return assertion;
42: }
43:
44: @Override
45: public Value<T> getValue() {
46: return value;
47: }
48:
49: @Override
50: public boolean equals(Object o) {
51:• if (this == o) {
52: return true;
53: }
54:• if (o == null || getClass() != o.getClass()) {
55: return false;
56: }
57: AxiomImpl<?> axiom = (AxiomImpl<?>) o;
58:• return subject.equals(axiom.subject) && assertion.equals(axiom.assertion) && value.equals(axiom.value);
59: }
60:
61: @Override
62: public int hashCode() {
63: return Objects.hash(subject, assertion, value);
64: }
65:
66: @Override
67: public String toString() {
68: return "[" + subject + " " + assertion + " " + value + "]";
69: }
70: }