Skip to content

Package: OWLClassM$Severity

OWLClassM$Severity

nameinstructionbranchcomplexitylinemethod
static {...}
M: 0 C: 34
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

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;
16:
17: import cz.cvut.kbss.jopa.model.annotations.Id;
18: import cz.cvut.kbss.jopa.model.annotations.OWLClass;
19: import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty;
20: import cz.cvut.kbss.jopa.test.environment.Generators;
21:
22: import java.util.Date;
23: import java.util.Set;
24: import java.util.stream.Collectors;
25: import java.util.stream.IntStream;
26:
27: /**
28: * Contains a generated string URI and data property attributes of primitive wrapper types
29: * - boolean, int, long, double and date.
30: */
31: @OWLClass(iri = Vocabulary.C_OWL_CLASS_M)
32: public class OWLClassM {
33:
34: @Id(generated = true)
35: private String key;
36:
37: @OWLDataProperty(iri = Vocabulary.p_m_booleanAttribute)
38: private Boolean booleanAttribute;
39:
40: @OWLDataProperty(iri = Vocabulary.p_m_intAttribute)
41: private Integer intAttribute;
42:
43: @OWLDataProperty(iri = Vocabulary.p_m_longAttribute)
44: private Long longAttribute;
45:
46: @OWLDataProperty(iri = Vocabulary.p_m_doubleAttribute)
47: private Double doubleAttribute;
48:
49: @OWLDataProperty(iri = Vocabulary.p_m_dateAttribute)
50: private Date dateAttribute;
51:
52: @OWLDataProperty(iri = Vocabulary.p_m_enumAttribute)
53: private Severity enumAttribute;
54:
55: @OWLDataProperty(iri = Vocabulary.p_m_IntegerSet)
56: private Set<Integer> integerSet;
57:
58: @OWLDataProperty(iri = Vocabulary.p_m_lexicalForm, lexicalForm = true)
59: private String lexicalForm;
60:
61: @OWLDataProperty(iri = Vocabulary.p_m_simpleLiteral, simpleLiteral = true)
62: private String simpleLiteral;
63:
64: public enum Severity {
65: LOW, MEDIUM, HIGH
66: }
67:
68: public String getKey() {
69: return key;
70: }
71:
72: public void setKey(String key) {
73: this.key = key;
74: }
75:
76: public Boolean getBooleanAttribute() {
77: return booleanAttribute;
78: }
79:
80: public void setBooleanAttribute(Boolean booleanAttribute) {
81: this.booleanAttribute = booleanAttribute;
82: }
83:
84: public Integer getIntAttribute() {
85: return intAttribute;
86: }
87:
88: public void setIntAttribute(Integer intAttribute) {
89: this.intAttribute = intAttribute;
90: }
91:
92: public Long getLongAttribute() {
93: return longAttribute;
94: }
95:
96: public void setLongAttribute(Long longAttribute) {
97: this.longAttribute = longAttribute;
98: }
99:
100: public Double getDoubleAttribute() {
101: return doubleAttribute;
102: }
103:
104: public void setDoubleAttribute(Double doubleAttribute) {
105: this.doubleAttribute = doubleAttribute;
106: }
107:
108: public Date getDateAttribute() {
109: return dateAttribute;
110: }
111:
112: public void setDateAttribute(Date dateAttribute) {
113: this.dateAttribute = dateAttribute;
114: }
115:
116: public Severity getEnumAttribute() {
117: return enumAttribute;
118: }
119:
120: public void setEnumAttribute(Severity enumAttribute) {
121: this.enumAttribute = enumAttribute;
122: }
123:
124: public Set<Integer> getIntegerSet() {
125: return integerSet;
126: }
127:
128: public void setIntegerSet(Set<Integer> integerSet) {
129: this.integerSet = integerSet;
130: }
131:
132: public String getLexicalForm() {
133: return lexicalForm;
134: }
135:
136: public void setLexicalForm(String lexicalForm) {
137: this.lexicalForm = lexicalForm;
138: }
139:
140: public String getSimpleLiteral() {
141: return simpleLiteral;
142: }
143:
144: public void setSimpleLiteral(String simpleLiteral) {
145: this.simpleLiteral = simpleLiteral;
146: }
147:
148: @Override
149: public String toString() {
150: return "OWLCLassM{" +
151: "key='" + key + '\'' +
152: ", booleanAttribute=" + booleanAttribute +
153: ", intAttribute=" + intAttribute +
154: ", longAttribute=" + longAttribute +
155: ", doubleAttribute=" + doubleAttribute +
156: ", enumAttribute=" + enumAttribute +
157: ", integerSet=" + integerSet +
158: ", lexicalForm=" + lexicalForm +
159: ", simpleLiteral=" + simpleLiteral +
160: '}';
161: }
162:
163: public void initializeTestValues(boolean includingKey) {
164: if (includingKey) {
165: this.key = "http://krizik.felk.cvut.cz/ontologies/entityM";
166: }
167: this.booleanAttribute = true;
168: this.intAttribute = 117;
169: this.longAttribute = 365L;
170: this.doubleAttribute = 3.14D;
171: this.dateAttribute = new Date();
172: this.enumAttribute = Severity.MEDIUM;
173: this.integerSet = IntStream.generate(Generators::randomInt).limit(10).boxed().collect(Collectors.toSet());
174: }
175: }