1 package info.magnolia.cms.cache; 2 3 import info.magnolia.cms.core.Path; 4 5 import java.io.Serializable ; 6 7 import javax.servlet.http.HttpServletRequest ; 8 9 10 14 public class CacheKey implements Serializable { 15 16 19 private static final long serialVersionUID = 222L; 20 21 private String key; 22 23 26 public CacheKey() { 27 } 28 29 32 public CacheKey(String key) { 33 this.key = key; 34 } 35 36 40 public CacheKey(HttpServletRequest request) { 41 key = Path.getURI(request); 42 } 43 44 47 public boolean equals(Object obj) { 48 return key.equals(((CacheKey) obj).key); 49 } 50 51 54 public int hashCode() { 55 return key.hashCode(); 56 } 57 58 61 public String toString() { 62 return key; 64 } 65 66 } 67 | Popular Tags |