gICS_2.8.6
PolicyDTO.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 
46 public class PolicyDTO implements Serializable {
47 
48  private static final long serialVersionUID = -98288145960857096L;
49  private PolicyKeyDTO key;
50  private String comment;
51  private String externProperties;
52 
53  public PolicyDTO() {
54  }
55 
56  public PolicyDTO(PolicyKeyDTO key) {
57  super();
58  this.key = key;
59  }
60 
61  public PolicyDTO(PolicyKeyDTO key, String comment, String externProperties) {
62  super();
63  this.key = key;
64  this.comment = comment;
65  this.externProperties = externProperties;
66  }
67 
68  public PolicyKeyDTO getKey() {
69  return key;
70  }
71 
72  public void setKey(PolicyKeyDTO key) {
73  if (key != null) {
74  this.key = key;
75  }
76  }
77 
78  public String getComment() {
79  return comment;
80  }
81 
82  public void setComment(String comment) {
83  this.comment = comment;
84  }
85 
86  public String getExternProperties() {
87  return externProperties;
88  }
89 
90  public void setExternProperties(String externProperties) {
91  this.externProperties = externProperties;
92  }
93 
94  @Override
95  public int hashCode() {
96  final int prime = 31;
97  int result = 1;
98  result = prime * result + ((comment == null) ? 0 : comment.hashCode());
99  result = prime * result + ((externProperties == null) ? 0 : externProperties.hashCode());
100  result = prime * result + ((key == null) ? 0 : key.hashCode());
101  return result;
102  }
103 
104  @Override
105  public boolean equals(Object obj) {
106  if (this == obj)
107  return true;
108  if (obj == null)
109  return false;
110  if (getClass() != obj.getClass())
111  return false;
112  PolicyDTO other = (PolicyDTO) obj;
113  if (comment == null) {
114  if (other.comment != null)
115  return false;
116  } else if (!comment.equals(other.comment))
117  return false;
118  if (externProperties == null) {
119  if (other.externProperties != null)
120  return false;
121  } else if (!externProperties.equals(other.externProperties))
122  return false;
123  if (key == null) {
124  if (other.key != null)
125  return false;
126  } else if (!key.equals(other.key))
127  return false;
128  return true;
129  }
130 
131  @Override
132  public String toString() {
133  return (key == null) ? "POLICY DTO WITH NULL AS KEY" : key.toString();
134  }
135 }
eine policy ist die kleinstmoegliche unterteilung eines consents; sie repraesentiert eine atomare...
Definition: PolicyDTO.java:46