1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.internal.context;
21
22 public final class RendererCacheKey {
23 private final ClientPropertiesKey cacheKey;
24 private final String name;
25 private final int hashCode;
26
27 public RendererCacheKey(ClientPropertiesKey cacheKey, String name) {
28 this.cacheKey = cacheKey;
29 this.name = name;
30 hashCode = calcHashCode();
31 }
32
33 @Override
34 public boolean equals(Object o) {
35 if (this == o) {
36 return true;
37 }
38 if (o == null || getClass() != o.getClass()) {
39 return false;
40 }
41
42 RendererCacheKey that = (RendererCacheKey) o;
43
44 return cacheKey.equals(that.cacheKey) && name.equals(that.name);
45 }
46
47 private int calcHashCode() {
48 int result;
49 result = cacheKey.hashCode();
50 result = 31 * result + name.hashCode();
51 return result;
52 }
53
54 @Override
55 public int hashCode() {
56 return hashCode;
57 }
58
59 @Override
60 public String toString() {
61 return "RendererCacheKey(" + cacheKey + "," + name + "," + hashCode + ')';
62 }
63 }