Skip to content

Method: initializeTestValues(boolean)

1: /**
2: * Copyright (C) 2016 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:
21: import java.util.Date;
22:
23: /**
24: * Contains a generated string URI and data property attributes of primitive wrapper types
25: * - boolean, int, long, double and date.
26: *
27: * @author ledvima1
28: */
29: @OWLClass(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/entities#OWLClassM")
30: public class OWLClassM {
31:
32: @Id(generated = true)
33: private String key;
34:
35: @OWLDataProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#m-booleanAttribute")
36: private Boolean booleanAttribute;
37:
38: @OWLDataProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#m-intAttribute")
39: private Integer intAttribute;
40:
41: @OWLDataProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#m-longAttribute")
42: private Long longAttribute;
43:
44: @OWLDataProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#m-doubleAttribute")
45: private Double doubleAttribute;
46:
47: @OWLDataProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#m-dateAttribute")
48: private Date dateAttribute;
49:
50: @OWLDataProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#m-enumAttribute")
51: private Severity enumAttribute;
52:
53: public enum Severity {
54: LOW, MEDIUM, HIGH
55: }
56:
57: public String getKey() {
58: return key;
59: }
60:
61: public void setKey(String key) {
62: this.key = key;
63: }
64:
65: public Boolean getBooleanAttribute() {
66: return booleanAttribute;
67: }
68:
69: public void setBooleanAttribute(Boolean booleanAttribute) {
70: this.booleanAttribute = booleanAttribute;
71: }
72:
73: public Integer getIntAttribute() {
74: return intAttribute;
75: }
76:
77: public void setIntAttribute(Integer intAttribute) {
78: this.intAttribute = intAttribute;
79: }
80:
81: public Long getLongAttribute() {
82: return longAttribute;
83: }
84:
85: public void setLongAttribute(Long longAttribute) {
86: this.longAttribute = longAttribute;
87: }
88:
89: public Double getDoubleAttribute() {
90: return doubleAttribute;
91: }
92:
93: public void setDoubleAttribute(Double doubleAttribute) {
94: this.doubleAttribute = doubleAttribute;
95: }
96:
97: public Date getDateAttribute() {
98: return dateAttribute;
99: }
100:
101: public void setDateAttribute(Date dateAttribute) {
102: this.dateAttribute = dateAttribute;
103: }
104:
105: public Severity getEnumAttribute() {
106: return enumAttribute;
107: }
108:
109: public void setEnumAttribute(Severity enumAttribute) {
110: this.enumAttribute = enumAttribute;
111: }
112:
113: @Override
114: public String toString() {
115: return "OWLCLassM{" +
116: "key='" + key + '\'' +
117: ", booleanAttribute=" + booleanAttribute +
118: ", intAttribute=" + intAttribute +
119: ", longAttribute=" + longAttribute +
120: ", doubleAttribute=" + doubleAttribute +
121: ", enumAttribute=" + enumAttribute +
122: '}';
123: }
124:
125: public void initializeTestValues(boolean includingKey) {
126:• if (includingKey) {
127: this.key = "http://krizik.felk.cvut.cz/ontologies/entityM";
128: }
129: this.booleanAttribute = true;
130: this.intAttribute = 117;
131: this.longAttribute = 365L;
132: this.doubleAttribute = 3.14D;
133: this.dateAttribute = new Date();
134: this.enumAttribute = Severity.MEDIUM;
135: }
136: }