Skip to content

Method: toString()

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.*;
18:
19: import java.net.URI;
20: import java.util.Set;
21:
22: @OWLClass(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/entities#OWLClassA")
23: public class OWLClassA {
24:
25:         @Types(fetchType = FetchType.EAGER)
26:         private Set<String> types;
27:
28:         @Id
29:         private URI uri;
30:
31:         @OWLDataProperty(iri = "http://krizik.felk.cvut.cz/ontologies/jopa/attributes#A-stringAttribute")
32:         private String stringAttribute;
33:
34:         public OWLClassA() {
35:         }
36:
37:         public OWLClassA(URI uri) {
38:                 this.uri = uri;
39:         }
40:
41:         /**
42:          * @param uri
43:          * the uri to set
44:          */
45:         public void setUri(URI uri) {
46:                 this.uri = uri;
47:         }
48:
49:         /**
50:          * @return the uri
51:          */
52:         public URI getUri() {
53:                 return uri;
54:         }
55:
56:         public void setStringAttribute(String stringAttribute) {
57:                 this.stringAttribute = stringAttribute;
58:         }
59:
60:         public String getStringAttribute() {
61:                 return stringAttribute;
62:         }
63:
64:         public void setTypes(Set<String> types) {
65:                 this.types = types;
66:         }
67:
68:         public Set<String> getTypes() {
69:                 return types;
70:         }
71:
72:         @Override
73:         public String toString() {
74:                 String out = "OWLClassA: uri = " + uri;
75:                 out += ", stringAttribute = " + stringAttribute;
76:•                if (types != null) {
77:                         out += ", types = {" + types.toString() + "}";
78:                 }
79:                 return out;
80:         }
81: }