1 package org.emau.icmvc.ganimed.ttp.cm2.dto;
38 import java.io.Serializable;
39 import java.util.Arrays;
40 import java.util.List;
55 private static final long serialVersionUID = 9152603229919432413L;
58 private String ctVersionConverter;
59 private String moduleVersionConverter;
60 private String policyVersionConverter;
61 private String properties;
62 private String comment;
63 private String externProperties;
65 private List<String> signerIdTypes;
70 public DomainDTO(String name, String ctVersionConverter, String moduleVersionConverter, String policyVersionConverter,
71 List<String> signerIdTypes) {
74 this.ctVersionConverter = ctVersionConverter;
75 this.moduleVersionConverter = moduleVersionConverter;
76 this.policyVersionConverter = policyVersionConverter;
77 if (signerIdTypes != null) {
78 this.signerIdTypes = signerIdTypes;
82 public DomainDTO(String name, String label, String ctVersionConverter, String moduleVersionConverter, String policyVersionConverter,
83 String properties, String comment, String externProperties, String logo, List<String> signerIdTypes) {
87 this.ctVersionConverter = ctVersionConverter;
88 this.moduleVersionConverter = moduleVersionConverter;
89 this.policyVersionConverter = policyVersionConverter;
90 this.properties = properties;
91 this.comment = comment;
92 this.externProperties = externProperties;
94 if (signerIdTypes != null) {
95 this.signerIdTypes = signerIdTypes;
99 public String getName() {
103 public void setName(String name) {
107 public String getLabel() {
111 public void setLabel(String label) {
115 public String getCtVersionConverter() {
116 return ctVersionConverter;
119 public void setCtVersionConverter(String ctVersionConverter) {
120 this.ctVersionConverter = ctVersionConverter;
123 public String getModuleVersionConverter() {
124 return moduleVersionConverter;
127 public void setModuleVersionConverter(String moduleVersionConverter) {
128 this.moduleVersionConverter = moduleVersionConverter;
131 public String getPolicyVersionConverter() {
132 return policyVersionConverter;
135 public void setPolicyVersionConverter(String policyVersionConverter) {
136 this.policyVersionConverter = policyVersionConverter;
139 public String getProperty(String key) {
141 boolean found =
false;
143 if (key.equals(prop.toString())) {
151 for (String pair : properties.split(
";")) {
152 if (pair.contains(key)) {
153 return pair.split(
"=")[1].trim();
160 public String getProperties() {
164 public void setProperties(String properties) {
165 this.properties = properties;
168 public String getComment() {
172 public void setComment(String comment) {
173 this.comment = comment;
176 public String getExternProperties() {
177 return externProperties;
180 public void setExternProperties(String externProperties) {
181 this.externProperties = externProperties;
184 public String getLogo() {
188 public void setLogo(String logo) {
192 public List<String> getSignerIdTypes() {
193 return signerIdTypes;
196 public void setSignerIdTypes(List<String> signerIdTypes) {
197 if (signerIdTypes != null) {
198 this.signerIdTypes = signerIdTypes;
203 public int hashCode() {
204 final int prime = 31;
206 result = prime * result + ((comment == null) ? 0 : comment.hashCode());
207 result = prime * result + ((ctVersionConverter == null) ? 0 : ctVersionConverter.hashCode());
208 result = prime * result + ((externProperties == null) ? 0 : externProperties.hashCode());
209 result = prime * result + ((logo == null) ? 0 : logo.hashCode());
210 result = prime * result + ((label == null) ? 0 : label.hashCode());
211 result = prime * result + ((moduleVersionConverter == null) ? 0 : moduleVersionConverter.hashCode());
212 result = prime * result + ((name == null) ? 0 : name.hashCode());
213 result = prime * result + ((policyVersionConverter == null) ? 0 : policyVersionConverter.hashCode());
214 result = prime * result + ((properties == null) ? 0 : properties.hashCode());
215 result = prime * result + ((signerIdTypes == null) ? 0 : signerIdTypes.hashCode());
220 public boolean equals(Object obj) {
225 if (getClass() != obj.getClass())
228 if (comment == null) {
229 if (other.comment != null)
231 }
else if (!comment.equals(other.comment))
233 if (ctVersionConverter == null) {
234 if (other.ctVersionConverter != null)
236 }
else if (!ctVersionConverter.equals(other.ctVersionConverter))
238 if (externProperties == null) {
239 if (other.externProperties != null)
241 }
else if (!externProperties.equals(other.externProperties))
244 if (other.logo != null)
246 }
else if (!logo.equals(other.logo))
249 if (other.label != null)
251 }
else if (!label.equals(other.label))
253 if (moduleVersionConverter == null) {
254 if (other.moduleVersionConverter != null)
256 }
else if (!moduleVersionConverter.equals(other.moduleVersionConverter))
259 if (other.name != null)
261 }
else if (!name.equals(other.name))
263 if (policyVersionConverter == null) {
264 if (other.policyVersionConverter != null)
266 }
else if (!policyVersionConverter.equals(other.policyVersionConverter))
268 if (properties == null) {
269 if (other.properties != null)
271 }
else if (!properties.equals(other.properties))
273 if (signerIdTypes == null) {
274 if (other.signerIdTypes != null)
276 }
else if (!signerIdTypes.equals(other.signerIdTypes))
282 public String toString() {
283 StringBuilder sb =
new StringBuilder();
284 sb.append(
"domain with name '");
286 sb.append(
"', label '");
288 sb.append(
"', ct version converter '");
289 sb.append(ctVersionConverter);
290 sb.append(
"', module version converter '");
291 sb.append(moduleVersionConverter);
292 sb.append(
"', policy version converter '");
293 sb.append(policyVersionConverter);
294 sb.append(
"', comment '");
296 sb.append(
"', extern properties '");
297 sb.append(externProperties);
298 sb.append(
"', the following properties: '");
299 sb.append(properties);
300 sb.append((logo != null && !logo.isEmpty()) ?
", a logo" :
", no logo");
301 sb.append(
"' and signerIdTypes:");
302 for (String signerIdType : signerIdTypes) {
304 sb.append(signerIdType);
307 return sb.toString();
name - identifier label - label for the web-interface properties - semicolon separated key-value pa...
possible properties for a consent domain