1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.to;
20
21 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
22 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
23 import java.util.ArrayList;
24 import java.util.List;
25 import javax.ws.rs.PathParam;
26 import org.apache.commons.lang3.builder.EqualsBuilder;
27 import org.apache.commons.lang3.builder.HashCodeBuilder;
28 import org.apache.syncope.common.lib.types.AnyTypeKind;
29
30 public class AnyTypeTO implements EntityTO {
31
32 private static final long serialVersionUID = 6771657557616874373L;
33
34 private String key;
35
36 private AnyTypeKind kind;
37
38 private final List<String> classes = new ArrayList<>();
39
40 @Override
41 public String getKey() {
42 return key;
43 }
44
45 @PathParam("key")
46 @Override
47 public void setKey(final String key) {
48 this.key = key;
49 }
50
51 public AnyTypeKind getKind() {
52 return kind;
53 }
54
55 public void setKind(final AnyTypeKind kind) {
56 this.kind = kind;
57 }
58
59 @JacksonXmlElementWrapper(localName = "classes")
60 @JacksonXmlProperty(localName = "class")
61 public List<String> getClasses() {
62 return classes;
63 }
64
65 @Override
66 public boolean equals(final Object obj) {
67 if (this == obj) {
68 return true;
69 }
70 if (obj == null) {
71 return false;
72 }
73 if (getClass() != obj.getClass()) {
74 return false;
75 }
76 AnyTypeTO other = (AnyTypeTO) obj;
77 return new EqualsBuilder().
78 append(key, other.key).
79 append(kind, other.kind).
80 append(classes, other.classes).
81 build();
82 }
83
84 @Override
85 public int hashCode() {
86 return new HashCodeBuilder().
87 append(key).
88 append(kind).
89 append(classes).
90 build();
91 }
92 }