gICS_2.8.6
CheckConsentConfig.java
1 package org.emau.icmvc.ganimed.ttp.cm2.config;
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 
41 
61 public class CheckConsentConfig implements Serializable {
62 
63  private static final long serialVersionUID = -6636704676431609622L;
68  private IdMatching idMatchingType = IdMatching.AT_LEAST_ONE;
73  private boolean ignoreVersionNumber = false;
78  private boolean unknownStateIsConsideredAsDecline = false;
79 
80  public CheckConsentConfig() {
81  }
82 
83  public IdMatching getIdMatchingType() {
84  return idMatchingType;
85  }
86 
87  public void setIdMatchingType(IdMatching idMatchingType) {
88  this.idMatchingType = idMatchingType;
89  }
90 
91  public boolean getIgnoreVersionNumber() {
92  return ignoreVersionNumber;
93  }
94 
95  public void setIgnoreVersionNumber(boolean ignoreVersionNumber) {
96  this.ignoreVersionNumber = ignoreVersionNumber;
97  }
98 
99  public boolean getUnknownStateIsConsideredAsDecline() {
101  }
102 
103  public void setUnknownStateIsConsideredAsDecline(boolean unknownStateIsConsideredAsDecline) {
104  this.unknownStateIsConsideredAsDecline = unknownStateIsConsideredAsDecline;
105  }
106 
107  @Override
108  public int hashCode() {
109  final int prime = 31;
110  int result = 1;
111  result = prime * result + ((idMatchingType == null) ? 0 : idMatchingType.hashCode());
112  result = prime * result + (ignoreVersionNumber ? 1231 : 1237);
113  result = prime * result + (unknownStateIsConsideredAsDecline ? 1231 : 1237);
114  return result;
115  }
116 
117  @Override
118  public boolean equals(Object obj) {
119  if (this == obj)
120  return true;
121  if (obj == null)
122  return false;
123  if (getClass() != obj.getClass())
124  return false;
125  CheckConsentConfig other = (CheckConsentConfig) obj;
126  if (idMatchingType != other.idMatchingType)
127  return false;
128  if (ignoreVersionNumber != other.ignoreVersionNumber)
129  return false;
130  if (unknownStateIsConsideredAsDecline != other.unknownStateIsConsideredAsDecline)
131  return false;
132  return true;
133  }
134 
135  @Override
136  public String toString() {
137  StringBuilder sb = new StringBuilder("check consent config with the following settings:\n");
138  sb.append("signer id matching type: ");
139  sb.append(idMatchingType);
140  sb.append("\nignore version number: ");
141  sb.append(ignoreVersionNumber);
142  sb.append("\nunknown state is considered as decline: ");
144  return sb.toString();
145  }
146 
147  public enum IdMatching {
148  AT_LEAST_ONE, AT_LEAST_ALL, EXACT;
149  }
150 }
boolean ignoreVersionNumber
ignore the version number of the policy default = false
boolean unknownStateIsConsideredAsDecline
if the consent state type "unknown" is encountered, it&#39;s considered as "declined" for the "isConsente...
IdMatching idMatchingType
match at least one, at least all or exact all of the given signer identifiers default = AT_LEAST_ONE...
configuration for the check whether the given policy is consented by the given person ...
ordnet die verschiedenen status nach "zugestimmt", "verweigert" und "unbekannt" see ConsentStatus ...