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