Skip to content

Package: ClassAssertion

ClassAssertion

nameinstructionbranchcomplexitylinemethod
ClassAssertion(boolean)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
equals(Object)
M: 0 C: 16
100%
M: 1 C: 5
83%
M: 1 C: 3
75%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLanguage()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getType()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
hasLanguage()
M: 0 C: 2
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: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 4
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 cz.cvut.kbss.ontodriver.util.Vocabulary;
21:
22: import java.net.URI;
23:
24: class ClassAssertion extends Assertion {
25:
26: static final URI RDF_TYPE = URI.create(Vocabulary.RDF_TYPE);
27:
28: ClassAssertion(boolean isInferred) {
29: super(RDF_TYPE, isInferred);
30: }
31:
32: /**
33: * Always returns {@code null}, because language is irrelevant for object properties.
34: *
35: * @return {@code null}
36: */
37: @Override
38: public String getLanguage() {
39: return null;
40: }
41:
42: /**
43: * Always returns {@code false}.
44: *
45: * @return {@code false}
46: */
47: @Override
48: public boolean hasLanguage() {
49: return false;
50: }
51:
52: @Override
53: public AssertionType getType() {
54: return AssertionType.CLASS;
55: }
56:
57: @Override
58: public int hashCode() {
59: int prime = 31;
60: return prime * super.hashCode();
61: }
62:
63: @Override
64: public boolean equals(Object obj) {
65:• return this == obj || super.equals(obj) && getClass() == obj.getClass();
66: }
67: }