1 /*
2 * Copyright 2007 Hippo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS"
12 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package nl.hippo.portal.cms.cache;
17
18 /***
19 * @author <a href="mailto:d.dam@hippo.nl">Dennis Dam</a>
20 *
21 * @version $Id: PortalCacheKeyImpl.java 6523 2007-05-22 13:20:55Z ddam $
22 */
23 public class PortalCacheKeyImpl implements PortalCacheKey {
24
25 private static final long serialVersionUID = 1L;
26
27 private final String key;
28
29 PortalCacheKeyImpl(String key) {
30 this.key = key;
31 }
32
33 public String getKey() {
34 return key;
35 }
36
37 public String toString() {
38 return key;
39 }
40
41 public boolean equals(Object object) {
42 if (object != null && object instanceof PortalCacheKeyImpl) {
43 PortalCacheKeyImpl ock = (PortalCacheKeyImpl) object;
44 return ock.getKey().equals(this.key);
45 }
46 return false;
47 }
48
49 public int hashCode() {
50 return key.hashCode();
51 }
52
53 }