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) 2022 Czech Technical University in Prague
3: * <p>
4: * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
5: * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
6: * version.
7: * <p>
8: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
9: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
10: * details. You should have received a copy of the GNU General Public License along with this program. If not, see
11: * <http://www.gnu.org/licenses/>.
12: */
13: package cz.cvut.kbss.jopa.test;
14:
15: import cz.cvut.kbss.jopa.model.annotations.Convert;
16: import cz.cvut.kbss.jopa.model.annotations.Id;
17: import cz.cvut.kbss.jopa.model.annotations.OWLClass;
18: import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty;
19: import cz.cvut.kbss.jopa.test.environment.Generators;
20: import cz.cvut.kbss.jopa.test.environment.TestEnvironment;
21: import cz.cvut.kbss.ontodriver.model.LangString;
22:
23: import java.time.ZoneOffset;
24: import java.util.*;
25: import java.util.stream.Collectors;
26: import java.util.stream.IntStream;
27:
28: /**
29: * Contains a generated string URI and data property attributes of primitive wrapper types
30: * - boolean, int, long, double and date.
31: */
32: @OWLClass(iri = Vocabulary.C_OWL_CLASS_M)
33: public class OWLClassM {
34:
35: @Id(generated = true)
36: private String key;
37:
38: @OWLDataProperty(iri = Vocabulary.p_m_booleanAttribute)
39: private Boolean booleanAttribute;
40:
41: @OWLDataProperty(iri = Vocabulary.p_m_intAttribute)
42: private Integer intAttribute;
43:
44: @OWLDataProperty(iri = Vocabulary.p_m_longAttribute)
45: private Long longAttribute;
46:
47: @OWLDataProperty(iri = Vocabulary.p_m_floatAttribute)
48: private Float floatAttribute;
49:
50: @OWLDataProperty(iri = Vocabulary.p_m_doubleAttribute)
51: private Double doubleAttribute;
52:
53: @OWLDataProperty(iri = Vocabulary.p_m_dateAttribute)
54: private Date dateAttribute;
55:
56: @OWLDataProperty(iri = Vocabulary.p_m_enumAttribute)
57: private Severity enumAttribute;
58:
59: @OWLDataProperty(iri = Vocabulary.p_m_IntegerSet)
60: private Set<Integer> integerSet;
61:
62: @OWLDataProperty(iri = Vocabulary.p_m_lexicalForm, lexicalForm = true)
63: private String lexicalForm;
64:
65: @OWLDataProperty(iri = Vocabulary.p_m_simpleLiteral, simpleLiteral = true)
66: private String simpleLiteral;
67:
68: @OWLDataProperty(iri = Vocabulary.p_m_StringCollection)
69: private Collection<String> stringCollection;
70:
71: @OWLDataProperty(iri = Vocabulary.p_m_explicitDatatype, datatype = TestEnvironment.EXPLICIT_DATATYPE)
72: private String explicitDatatype;
73:
74: @OWLDataProperty(iri = Vocabulary.p_m_langString)
75: private LangString langString;
76:
77: @OWLDataProperty(iri = Vocabulary.p_m_enumSimpleLiteralAttribute, simpleLiteral = true)
78: private Severity enumSimpleLiteral;
79:
80: @Convert(converter = ZoneOffsetConverter.class)
81: @OWLDataProperty(iri = Vocabulary.p_m_withConverter, simpleLiteral = true)
82: private ZoneOffset withConverter;
83:
84: public enum Severity {
85: LOW, MEDIUM, HIGH
86: }
87:
88: public String getKey() {
89: return key;
90: }
91:
92: public void setKey(String key) {
93: this.key = key;
94: }
95:
96: public Boolean getBooleanAttribute() {
97: return booleanAttribute;
98: }
99:
100: public void setBooleanAttribute(Boolean booleanAttribute) {
101: this.booleanAttribute = booleanAttribute;
102: }
103:
104: public Integer getIntAttribute() {
105: return intAttribute;
106: }
107:
108: public void setIntAttribute(Integer intAttribute) {
109: this.intAttribute = intAttribute;
110: }
111:
112: public Long getLongAttribute() {
113: return longAttribute;
114: }
115:
116: public void setLongAttribute(Long longAttribute) {
117: this.longAttribute = longAttribute;
118: }
119:
120: public Float getFloatAttribute() {
121: return floatAttribute;
122: }
123:
124: public void setFloatAttribute(Float floatAttribute) {
125: this.floatAttribute = floatAttribute;
126: }
127:
128: public Double getDoubleAttribute() {
129: return doubleAttribute;
130: }
131:
132: public void setDoubleAttribute(Double doubleAttribute) {
133: this.doubleAttribute = doubleAttribute;
134: }
135:
136: public Date getDateAttribute() {
137: return dateAttribute;
138: }
139:
140: public void setDateAttribute(Date dateAttribute) {
141: this.dateAttribute = dateAttribute;
142: }
143:
144: public Severity getEnumAttribute() {
145: return enumAttribute;
146: }
147:
148: public void setEnumAttribute(Severity enumAttribute) {
149: this.enumAttribute = enumAttribute;
150: }
151:
152: public Set<Integer> getIntegerSet() {
153: return integerSet;
154: }
155:
156: public void setIntegerSet(Set<Integer> integerSet) {
157: this.integerSet = integerSet;
158: }
159:
160: public String getLexicalForm() {
161: return lexicalForm;
162: }
163:
164: public void setLexicalForm(String lexicalForm) {
165: this.lexicalForm = lexicalForm;
166: }
167:
168: public String getSimpleLiteral() {
169: return simpleLiteral;
170: }
171:
172: public void setSimpleLiteral(String simpleLiteral) {
173: this.simpleLiteral = simpleLiteral;
174: }
175:
176: public Collection<String> getStringCollection() {
177: return stringCollection;
178: }
179:
180: public void setStringCollection(Collection<String> stringCollection) {
181: this.stringCollection = stringCollection;
182: }
183:
184: public String getExplicitDatatype() {
185: return explicitDatatype;
186: }
187:
188: public void setExplicitDatatype(String explicitDatatype) {
189: this.explicitDatatype = explicitDatatype;
190: }
191:
192: public LangString getLangString() {
193: return langString;
194: }
195:
196: public void setLangString(LangString langString) {
197: this.langString = langString;
198: }
199:
200: public Severity getEnumSimpleLiteral() {
201: return enumSimpleLiteral;
202: }
203:
204: public void setEnumSimpleLiteral(Severity enumSimpleLiteral) {
205: this.enumSimpleLiteral = enumSimpleLiteral;
206: }
207:
208: public ZoneOffset getWithConverter() {
209: return withConverter;
210: }
211:
212: public void setWithConverter(ZoneOffset withConverter) {
213: this.withConverter = withConverter;
214: }
215:
216: @Override
217: public String toString() {
218: return "OWLCLassM{" +
219: "key='" + key + '\'' +
220: ", booleanAttribute=" + booleanAttribute +
221: ", intAttribute=" + intAttribute +
222: ", longAttribute=" + longAttribute +
223: ", floatAttribute=" + floatAttribute +
224: ", doubleAttribute=" + doubleAttribute +
225: ", enumAttribute=" + enumAttribute +
226: ", integerSet=" + integerSet +
227: ", lexicalForm=" + lexicalForm +
228: ", simpleLiteral=" + simpleLiteral +
229: ", stringCollection=" + stringCollection +
230: ", explicitDatatype=" + explicitDatatype +
231: ", langString=" + langString +
232: ", enumSimpleLiteral=" + enumSimpleLiteral +
233: ", withConverter=" + withConverter +
234: '}';
235: }
236:
237: public void initializeTestValues(boolean includingKey) {
238: if (includingKey) {
239: this.key = "http://krizik.felk.cvut.cz/ontologies/entityM";
240: }
241: this.booleanAttribute = true;
242: this.intAttribute = 117;
243: this.longAttribute = 365L;
244: this.floatAttribute = 3.14F;
245: this.doubleAttribute = 3.14D;
246: this.dateAttribute = new Date();
247: this.enumAttribute = Severity.MEDIUM;
248: this.integerSet = IntStream.generate(Generators::randomInt).limit(10).boxed().collect(Collectors.toSet());
249: this.stringCollection = new HashSet<>(Arrays.asList("test-one", "test-two", "test-three"));
250: this.enumSimpleLiteral = Severity.HIGH;
251: this.withConverter = ZoneOffset.UTC;
252: }
253: }