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_doubleAttribute)
46: private Double doubleAttribute;
47:
48: @OWLDataProperty(iri = Vocabulary.p_m_dateAttribute)
49: private Date dateAttribute;
50:
51: @OWLDataProperty(iri = Vocabulary.p_m_enumAttribute)
52: private Severity enumAttribute;
53:
54: @OWLDataProperty(iri = Vocabulary.p_m_IntegerSet)
55: private Set<Integer> integerSet;
56:
57: @OWLDataProperty(iri = Vocabulary.p_m_lexicalForm, lexicalForm = true)
58: private String lexicalForm;
59:
60: @OWLDataProperty(iri = Vocabulary.p_m_simpleLiteral, simpleLiteral = true)
61: private String simpleLiteral;
62:
63: @OWLDataProperty(iri = Vocabulary.p_m_StringCollection)
64: private Collection<String> stringCollection;
65:
66: public enum Severity {
67: LOW, MEDIUM, HIGH
68: }
69:
70: public String getKey() {
71: return key;
72: }
73:
74: public void setKey(String key) {
75: this.key = key;
76: }
77:
78: public Boolean getBooleanAttribute() {
79: return booleanAttribute;
80: }
81:
82: public void setBooleanAttribute(Boolean booleanAttribute) {
83: this.booleanAttribute = booleanAttribute;
84: }
85:
86: public Integer getIntAttribute() {
87: return intAttribute;
88: }
89:
90: public void setIntAttribute(Integer intAttribute) {
91: this.intAttribute = intAttribute;
92: }
93:
94: public Long getLongAttribute() {
95: return longAttribute;
96: }
97:
98: public void setLongAttribute(Long longAttribute) {
99: this.longAttribute = longAttribute;
100: }
101:
102: public Double getDoubleAttribute() {
103: return doubleAttribute;
104: }
105:
106: public void setDoubleAttribute(Double doubleAttribute) {
107: this.doubleAttribute = doubleAttribute;
108: }
109:
110: public Date getDateAttribute() {
111: return dateAttribute;
112: }
113:
114: public void setDateAttribute(Date dateAttribute) {
115: this.dateAttribute = dateAttribute;
116: }
117:
118: public Severity getEnumAttribute() {
119: return enumAttribute;
120: }
121:
122: public void setEnumAttribute(Severity enumAttribute) {
123: this.enumAttribute = enumAttribute;
124: }
125:
126: public Set<Integer> getIntegerSet() {
127: return integerSet;
128: }
129:
130: public void setIntegerSet(Set<Integer> integerSet) {
131: this.integerSet = integerSet;
132: }
133:
134: public String getLexicalForm() {
135: return lexicalForm;
136: }
137:
138: public void setLexicalForm(String lexicalForm) {
139: this.lexicalForm = lexicalForm;
140: }
141:
142: public String getSimpleLiteral() {
143: return simpleLiteral;
144: }
145:
146: public void setSimpleLiteral(String simpleLiteral) {
147: this.simpleLiteral = simpleLiteral;
148: }
149:
150: public Collection<String> getStringCollection() {
151: return stringCollection;
152: }
153:
154: public void setStringCollection(Collection<String> stringCollection) {
155: this.stringCollection = stringCollection;
156: }
157:
158: @Override
159: public String toString() {
160: return "OWLCLassM{" +
161: "key='" + key + '\'' +
162: ", booleanAttribute=" + booleanAttribute +
163: ", intAttribute=" + intAttribute +
164: ", longAttribute=" + longAttribute +
165: ", doubleAttribute=" + doubleAttribute +
166: ", enumAttribute=" + enumAttribute +
167: ", integerSet=" + integerSet +
168: ", lexicalForm=" + lexicalForm +
169: ", simpleLiteral=" + simpleLiteral +
170: ", stringCollection=" + stringCollection +
171: '}';
172: }
173:
174: public void initializeTestValues(boolean includingKey) {
175: if (includingKey) {
176: this.key = "http://krizik.felk.cvut.cz/ontologies/entityM";
177: }
178: this.booleanAttribute = true;
179: this.intAttribute = 117;
180: this.longAttribute = 365L;
181: this.doubleAttribute = 3.14D;
182: this.dateAttribute = new Date();
183: this.enumAttribute = Severity.MEDIUM;
184: this.integerSet = IntStream.generate(Generators::randomInt).limit(10).boxed().collect(Collectors.toSet());
185: this.stringCollection = new HashSet<>(Arrays.asList("test-one", "test-two", "test-three"));
186: }
187: }