View Javadoc
1   /*
2    * Copyright 2018-2022 Medical Information Systems Research Group (https://medical.zcu.cz),
3    * Department of Computer Science and Engineering, University of West Bohemia.
4    * Address: Univerzitni 8, 306 14 Plzen, Czech Republic.
5    *
6    * Author Petr Vcelak (vcelak@kiv.zcu.cz).
7    *
8    * This file is part of MRECore project.
9    *
10   * MRECore is free software: you can redistribute it and/or modify
11   * it under the terms of the GNU General Public License as published by
12   * the Free Software Foundation, either version 3 of the License.
13   *
14   * MRECore is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17   * GNU General Public License for more details.
18   *
19   * You should have received a copy of the GNU General Public License
20   * along with MRECore. If not, see <http://www.gnu.org/licenses/>.
21   */
22  package cz.zcu.mre.service.data;
23  
24  import java.util.HashSet;
25  import java.util.Set;
26  import org.apache.jena.rdf.model.Property;
27  
28  /**
29   * Configuration and values for a generic MREData.
30   *
31   * @author Petr Vcelak (vcelak@kiv.zcu.cz)
32   */
33  public class MREDataFieldValue {
34  
35      /**
36       * The field configuration used by the MREData Builder.
37       */
38      private MREDataBuilderConfig config;
39  
40      /**
41       * The subject (URI).
42       */
43      private String subject;
44  
45      /**
46       * List of any objects/values.
47       */
48      private final Set<Object> value = new HashSet<>();
49  
50      /**
51       * Default constructor.
52       */
53      public MREDataFieldValue() {
54      }
55  
56      public MREDataBuilderConfig getConfig() {
57          return config;
58      }
59  
60      public void setConfig(MREDataBuilderConfig config) {
61          this.config = config;
62      }
63  
64      public String getSubject() {
65          return subject;
66      }
67  
68      public void setSubject(String subject) {
69          this.subject = subject;
70      }
71  
72      public Set<Object> getValue() {
73          return value;
74      }
75  
76      public String getName() {
77          return config.getName();
78      }
79  
80      public Property getProperty() {
81          return config.getProperty();
82      }
83  
84      @Override
85      public String toString() {
86          return "MREConverterFieldValue{" + "config=" + config.getName() + ", value=" + value + ", subject=" + subject + '}';
87      }
88  
89  }