gICS_2.8.6
ModuleDTO.java
1 package org.emau.icmvc.ganimed.ttp.cm2.dto;
2 
3 /*
4  * ###license-information-start###
5  * gICS - a Generic Informed Consent Service
6  * __
7  * Copyright (C) 2014 - 2018 The MOSAIC Project - Institut fuer Community
8  * Medicine of the University Medicine Greifswald -
9  * mosaic-projekt@uni-greifswald.de
10  *
11  * concept and implementation
12  * l.geidel
13  * web client
14  * a.blumentritt, m.bialke
15  *
16  * Selected functionalities of gICS were developed as part of the MAGIC Project (funded by the DFG HO 1937/5-1).
17  *
18  * please cite our publications
19  * http://dx.doi.org/10.3414/ME14-01-0133
20  * http://dx.doi.org/10.1186/s12967-015-0545-6
21  * http://dx.doi.org/10.3205/17gmds146
22  * __
23  * This program is free software: you can redistribute it and/or modify
24  * it under the terms of the GNU Affero General Public License as published by
25  * the Free Software Foundation, either version 3 of the License, or
26  * (at your option) any later version.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU Affero General Public License
34  * along with this program. If not, see <http://www.gnu.org/licenses/>.
35  * ###license-information-end###
36  */
37 
38 import java.io.Serializable;
39 import java.util.ArrayList;
40 import java.util.List;
41 
48 public class ModuleDTO implements Serializable {
49 
50  private static final long serialVersionUID = 7810170655576763368L;
51  private ModuleKeyDTO key;
52  private String text;
53  private String title;
54  private String comment;
55  private String externProperties;
56  private List<PolicyDTO> policies = new ArrayList<PolicyDTO>();
57 
58  public ModuleDTO() {
59  }
60 
61  public ModuleDTO(ModuleKeyDTO key) {
62  super();
63  this.key = key;
64  }
65 
66  public ModuleDTO(ModuleKeyDTO key, String text, List<PolicyDTO> policies) {
67  super();
68  this.key = key;
69  this.text = text;
70  if (policies != null) {
71  this.policies = policies;
72  }
73  }
74 
75  public ModuleDTO(ModuleKeyDTO key, String text, String title, String comment, String externProperties, List<PolicyDTO> policies) {
76  super();
77  this.key = key;
78  this.text = text;
79  this.title = title;
80  this.comment = comment;
81  this.externProperties = externProperties;
82  if (policies != null) {
83  this.policies = policies;
84  }
85  }
86 
87  public ModuleKeyDTO getKey() {
88  return key;
89  }
90 
91  public void setKey(ModuleKeyDTO key) {
92  if (key != null) {
93  this.key = key;
94  }
95  }
96 
97  public String getText() {
98  return text;
99  }
100 
101  public void setText(String text) {
102  this.text = text;
103  }
104 
105  public String getTitle() {
106  return title;
107  }
108 
109  public void setTitle(String title) {
110  this.title = title;
111  }
112 
113  public String getComment() {
114  return comment;
115  }
116 
117  public void setComment(String comment) {
118  this.comment = comment;
119  }
120 
121  public String getExternProperties() {
122  return externProperties;
123  }
124 
125  public void setExternProperties(String externProperties) {
126  this.externProperties = externProperties;
127  }
128 
129  public List<PolicyDTO> getPolicies() {
130  return policies;
131  }
132 
133  public void setPolicies(List<PolicyDTO> policies) {
134  if (policies != null) {
135  this.policies = policies;
136  }
137  }
138 
139  @Override
140  public int hashCode() {
141  final int prime = 31;
142  int result = 1;
143  result = prime * result + ((comment == null) ? 0 : comment.hashCode());
144  result = prime * result + ((externProperties == null) ? 0 : externProperties.hashCode());
145  result = prime * result + ((key == null) ? 0 : key.hashCode());
146  result = prime * result + ((policies == null) ? 0 : policies.hashCode());
147  result = prime * result + ((text == null) ? 0 : text.hashCode());
148  result = prime * result + ((title == null) ? 0 : title.hashCode());
149  return result;
150  }
151 
152  @Override
153  public boolean equals(Object obj) {
154  if (this == obj)
155  return true;
156  if (obj == null)
157  return false;
158  if (getClass() != obj.getClass())
159  return false;
160  ModuleDTO other = (ModuleDTO) obj;
161  if (comment == null) {
162  if (other.comment != null)
163  return false;
164  } else if (!comment.equals(other.comment))
165  return false;
166  if (externProperties == null) {
167  if (other.externProperties != null)
168  return false;
169  } else if (!externProperties.equals(other.externProperties))
170  return false;
171  if (key == null) {
172  if (other.key != null)
173  return false;
174  } else if (!key.equals(other.key))
175  return false;
176  if (policies == null) {
177  if (other.policies != null)
178  return false;
179  } else if (!policies.equals(other.policies))
180  return false;
181  if (text == null) {
182  if (other.text != null)
183  return false;
184  } else if (!text.equals(other.text))
185  return false;
186  if (title == null) {
187  if (other.title != null)
188  return false;
189  } else if (!title.equals(other.title))
190  return false;
191  return true;
192  }
193 
194  @Override
195  public String toString() {
196  return key.toString() + " with " + ((policies == null) ? 0 : policies.size()) + " policies";
197  }
198 }
ein modul ist eine zustimmbare unterteilung eines consents; sie fasst mehrere policies zusammen...
Definition: ModuleDTO.java:48