Skip to contentPackage: OWLClassM$Severity
OWLClassM$Severity
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.*;
16: import cz.cvut.kbss.jopa.test.environment.Generators;
17: import cz.cvut.kbss.jopa.test.environment.TestEnvironment;
18: import cz.cvut.kbss.ontodriver.model.LangString;
19:
20: import java.time.ZoneOffset;
21: import java.util.*;
22: import java.util.stream.Collectors;
23: import java.util.stream.IntStream;
24:
25: /**
26: * Contains a generated string URI and data property attributes of primitive wrapper types
27: * - boolean, int, long, double and date.
28: */
29: @OWLClass(iri = Vocabulary.C_OWL_CLASS_M)
30: public class OWLClassM {
31:
32: @Id(generated = true)
33: private String key;
34:
35: @OWLDataProperty(iri = Vocabulary.p_m_booleanAttribute)
36: private Boolean booleanAttribute;
37:
38: @OWLDataProperty(iri = Vocabulary.p_m_intAttribute)
39: private Integer intAttribute;
40:
41: @OWLDataProperty(iri = Vocabulary.p_m_longAttribute)
42: private Long longAttribute;
43:
44: @OWLDataProperty(iri = Vocabulary.p_m_floatAttribute)
45: private Float floatAttribute;
46:
47: @OWLDataProperty(iri = Vocabulary.p_m_doubleAttribute)
48: private Double doubleAttribute;
49:
50: @OWLDataProperty(iri = Vocabulary.p_m_dateAttribute)
51: private Date dateAttribute;
52:
53: @OWLDataProperty(iri = Vocabulary.p_m_enumAttribute)
54: private Severity enumAttribute;
55:
56: @Enumerated(EnumType.ORDINAL)
57: @OWLDataProperty(iri = Vocabulary.p_m_ordinalEnumAttribute)
58: private Severity ordinalEnumAttribute;
59:
60: @OWLDataProperty(iri = Vocabulary.p_m_IntegerSet)
61: private Set<Integer> integerSet;
62:
63: @OWLDataProperty(iri = Vocabulary.p_m_lexicalForm, lexicalForm = true)
64: private String lexicalForm;
65:
66: @OWLDataProperty(iri = Vocabulary.p_m_simpleLiteral, simpleLiteral = true)
67: private String simpleLiteral;
68:
69: @OWLDataProperty(iri = Vocabulary.p_m_StringCollection)
70: private Collection<String> stringCollection;
71:
72: @OWLDataProperty(iri = Vocabulary.p_m_explicitDatatype, datatype = TestEnvironment.EXPLICIT_DATATYPE)
73: private String explicitDatatype;
74:
75: @OWLDataProperty(iri = Vocabulary.p_m_langString)
76: private LangString langString;
77:
78: @OWLDataProperty(iri = Vocabulary.p_m_enumSimpleLiteralAttribute, simpleLiteral = true)
79: private Severity enumSimpleLiteral;
80:
81: @Convert(converter = ZoneOffsetConverter.class)
82: @OWLDataProperty(iri = Vocabulary.p_m_withConverter, simpleLiteral = true)
83: private ZoneOffset withConverter;
84:
85: @OWLAnnotationProperty(iri = Vocabulary.p_m_annotationSimpleLiteral, simpleLiteral = true)
86: private String annotationSimpleLiteral;
87:
88: public enum Severity {
89: LOW, MEDIUM, HIGH
90: }
91:
92: public String getKey() {
93: return key;
94: }
95:
96: public void setKey(String key) {
97: this.key = key;
98: }
99:
100: public Boolean getBooleanAttribute() {
101: return booleanAttribute;
102: }
103:
104: public void setBooleanAttribute(Boolean booleanAttribute) {
105: this.booleanAttribute = booleanAttribute;
106: }
107:
108: public Integer getIntAttribute() {
109: return intAttribute;
110: }
111:
112: public void setIntAttribute(Integer intAttribute) {
113: this.intAttribute = intAttribute;
114: }
115:
116: public Long getLongAttribute() {
117: return longAttribute;
118: }
119:
120: public void setLongAttribute(Long longAttribute) {
121: this.longAttribute = longAttribute;
122: }
123:
124: public Float getFloatAttribute() {
125: return floatAttribute;
126: }
127:
128: public void setFloatAttribute(Float floatAttribute) {
129: this.floatAttribute = floatAttribute;
130: }
131:
132: public Double getDoubleAttribute() {
133: return doubleAttribute;
134: }
135:
136: public void setDoubleAttribute(Double doubleAttribute) {
137: this.doubleAttribute = doubleAttribute;
138: }
139:
140: public Date getDateAttribute() {
141: return dateAttribute;
142: }
143:
144: public void setDateAttribute(Date dateAttribute) {
145: this.dateAttribute = dateAttribute;
146: }
147:
148: public Severity getEnumAttribute() {
149: return enumAttribute;
150: }
151:
152: public void setEnumAttribute(Severity enumAttribute) {
153: this.enumAttribute = enumAttribute;
154: }
155:
156: public Severity getOrdinalEnumAttribute() {
157: return ordinalEnumAttribute;
158: }
159:
160: public void setOrdinalEnumAttribute(Severity ordinalEnumAttribute) {
161: this.ordinalEnumAttribute = ordinalEnumAttribute;
162: }
163:
164: public Set<Integer> getIntegerSet() {
165: return integerSet;
166: }
167:
168: public void setIntegerSet(Set<Integer> integerSet) {
169: this.integerSet = integerSet;
170: }
171:
172: public String getLexicalForm() {
173: return lexicalForm;
174: }
175:
176: public void setLexicalForm(String lexicalForm) {
177: this.lexicalForm = lexicalForm;
178: }
179:
180: public String getSimpleLiteral() {
181: return simpleLiteral;
182: }
183:
184: public void setSimpleLiteral(String simpleLiteral) {
185: this.simpleLiteral = simpleLiteral;
186: }
187:
188: public Collection<String> getStringCollection() {
189: return stringCollection;
190: }
191:
192: public void setStringCollection(Collection<String> stringCollection) {
193: this.stringCollection = stringCollection;
194: }
195:
196: public String getExplicitDatatype() {
197: return explicitDatatype;
198: }
199:
200: public void setExplicitDatatype(String explicitDatatype) {
201: this.explicitDatatype = explicitDatatype;
202: }
203:
204: public LangString getLangString() {
205: return langString;
206: }
207:
208: public void setLangString(LangString langString) {
209: this.langString = langString;
210: }
211:
212: public Severity getEnumSimpleLiteral() {
213: return enumSimpleLiteral;
214: }
215:
216: public void setEnumSimpleLiteral(Severity enumSimpleLiteral) {
217: this.enumSimpleLiteral = enumSimpleLiteral;
218: }
219:
220: public ZoneOffset getWithConverter() {
221: return withConverter;
222: }
223:
224: public void setWithConverter(ZoneOffset withConverter) {
225: this.withConverter = withConverter;
226: }
227:
228: public String getAnnotationSimpleLiteral() {
229: return annotationSimpleLiteral;
230: }
231:
232: public void setAnnotationSimpleLiteral(String annotationSimpleLiteral) {
233: this.annotationSimpleLiteral = annotationSimpleLiteral;
234: }
235:
236: @Override
237: public String toString() {
238: return "OWLCLassM{" +
239: "key='" + key + '\'' +
240: ", booleanAttribute=" + booleanAttribute +
241: ", intAttribute=" + intAttribute +
242: ", longAttribute=" + longAttribute +
243: ", floatAttribute=" + floatAttribute +
244: ", doubleAttribute=" + doubleAttribute +
245: ", enumAttribute=" + enumAttribute +
246: ", ordinalEnumAttribute=" + ordinalEnumAttribute +
247: ", integerSet=" + integerSet +
248: ", lexicalForm=" + lexicalForm +
249: ", simpleLiteral=" + simpleLiteral +
250: ", stringCollection=" + stringCollection +
251: ", explicitDatatype=" + explicitDatatype +
252: ", langString=" + langString +
253: ", enumSimpleLiteral=" + enumSimpleLiteral +
254: ", withConverter=" + withConverter +
255: ", annotationSimpleLiteral=" + annotationSimpleLiteral +
256: '}';
257: }
258:
259: public void initializeTestValues(boolean includingKey) {
260: if (includingKey) {
261: this.key = "http://krizik.felk.cvut.cz/ontologies/entityM";
262: }
263: this.booleanAttribute = true;
264: this.intAttribute = 117;
265: this.longAttribute = 365L;
266: this.floatAttribute = 3.14F;
267: this.doubleAttribute = 3.14D;
268: this.dateAttribute = new Date();
269: this.enumAttribute = Severity.MEDIUM;
270: this.ordinalEnumAttribute = enumAttribute;
271: this.integerSet = IntStream.generate(Generators::randomInt).limit(10).boxed().collect(Collectors.toSet());
272: this.stringCollection = new HashSet<>(Arrays.asList("test-one", "test-two", "test-three"));
273: this.enumSimpleLiteral = Severity.HIGH;
274: this.withConverter = ZoneOffset.UTC;
275: }
276: }