1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.provisioning.api.cache;
20
21 import org.apache.commons.lang3.builder.EqualsBuilder;
22 import org.apache.commons.lang3.builder.HashCodeBuilder;
23
24
25
26
27 @SuppressWarnings("squid:S2065")
28 public class VirAttrCacheKey {
29
30
31
32
33 private final transient String anyType;
34
35
36
37
38 private final transient String any;
39
40
41
42
43 private final transient String schema;
44
45 public VirAttrCacheKey(final String anyType, final String any, final String schema) {
46 this.anyType = anyType;
47 this.any = any;
48 this.schema = schema;
49 }
50
51 public String getAnyType() {
52 return anyType;
53 }
54
55 public String getAny() {
56 return any;
57 }
58
59 public String getSchema() {
60 return schema;
61 }
62
63 @Override
64 public int hashCode() {
65 return new HashCodeBuilder().
66 append(anyType).
67 append(any).
68 append(schema).
69 build();
70 }
71
72 @Override
73 public boolean equals(final Object obj) {
74 if (this == obj) {
75 return true;
76 }
77 if (obj == null) {
78 return false;
79 }
80 if (getClass() != obj.getClass()) {
81 return false;
82 }
83 final VirAttrCacheKey other = (VirAttrCacheKey) obj;
84 return new EqualsBuilder().
85 append(anyType, other.anyType).
86 append(any, other.any).
87 append(schema, other.schema).
88 build();
89 }
90
91 @Override
92 public String toString() {
93 return "VirAttrCacheKey{" + "anyType=" + anyType + ", any=" + any + ", schema=" + schema + '}';
94 }
95 }