Skip to content

Package: Quad

Quad

nameinstructionbranchcomplexitylinemethod
Quad(URI, URI, Object)
M: 0 C: 23
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
Quad(URI, URI, Object, String)
M: 0 C: 23
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
Quad(URI, URI, Object, String, URI)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
Quad(URI, URI, Object, URI)
M: 0 C: 23
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
equals(Object)
M: 6 C: 41
87%
M: 7 C: 7
50%
M: 7 C: 1
13%
M: 2 C: 8
80%
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%
getLanguage()
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%
getProperty()
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: 29
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 49 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 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.test.environment;
16:
17: import java.net.URI;
18: import java.util.Objects;
19:
20: public class Quad {
21:
22: private final URI subject;
23: private final URI property;
24: private final Object value;
25: private final URI context;
26: private final String language;
27:
28: public Quad(URI subject, URI property, Object value) {
29: this.subject = Objects.requireNonNull(subject);
30: this.property = Objects.requireNonNull(property);
31: this.value = Objects.requireNonNull(value);
32: this.context = null;
33: this.language = "en";
34: }
35:
36: public Quad(URI subject, URI property, Object value, URI context) {
37: this.subject = Objects.requireNonNull(subject);
38: this.property = Objects.requireNonNull(property);
39: this.value = Objects.requireNonNull(value);
40: this.context = context;
41: this.language = "en";
42: }
43:
44: public Quad(URI subject, URI property, Object value, String language) {
45: this.subject = Objects.requireNonNull(subject);
46: this.property = Objects.requireNonNull(property);
47: this.value = Objects.requireNonNull(value);
48: this.context = null;
49: this.language = language;
50: }
51:
52: public Quad(URI subject, URI property, Object value, String language, URI context) {
53: this.subject = Objects.requireNonNull(subject);
54: this.property = Objects.requireNonNull(property);
55: this.value = Objects.requireNonNull(value);
56: this.context = context;
57: this.language = language;
58: }
59:
60: public URI getSubject() {
61: return subject;
62: }
63:
64: public URI getProperty() {
65: return property;
66: }
67:
68: public Object getValue() {
69: return value;
70: }
71:
72: public URI getContext() {
73: return context;
74: }
75:
76: public String getLanguage() {
77: return language;
78: }
79:
80: @Override
81: public boolean equals(Object o) {
82:• if (this == o) {
83: return true;
84: }
85:• if (!(o instanceof Quad)) {
86: return false;
87: }
88: Quad quad = (Quad) o;
89:• return subject.equals(quad.subject) &&
90:• property.equals(quad.property) &&
91:• value.equals(quad.value) &&
92:• Objects.equals(context, quad.context) &&
93:• Objects.equals(language, quad.language);
94: }
95:
96: @Override
97: public int hashCode() {
98: return Objects.hash(subject, property, value, context, language);
99: }
100:
101: @Override
102: public String toString() {
103: return "{" + subject + " " + property + " " + value +
104:• (language != null ? "@" + language : "") +
105:• (context != null ? " " + context : "") + "}";
106: }
107: }