1 package com.atlassian.plugin.webresource.cache;
2
3 import java.util.Arrays;
4 import java.util.List;
5 import java.util.SortedMap;
6
7
8
9
10 public class FileCacheKey {
11 private final SortedMap<String, String> params;
12 private final List<String> rest;
13
14 FileCacheKey(SortedMap<String, String> params, String... rest) {
15 this.params = params;
16 this.rest = Arrays.asList(rest);
17 }
18
19 @Override
20 public String toString() {
21 return "FileCacheKey{" +
22 "params=" + params +
23 ", rest=" + rest +
24 '}';
25 }
26
27 @Override
28 public boolean equals(Object o) {
29 if (this == o) return true;
30 if (o == null || getClass() != o.getClass()) return false;
31
32 FileCacheKey that = (FileCacheKey) o;
33
34 if (!params.equals(that.params)) return false;
35 if (!rest.equals(that.rest)) return false;
36
37 return true;
38 }
39
40 @Override
41 public int hashCode() {
42 int result = params.hashCode();
43 result = 31 * result + rest.hashCode();
44 return result;
45 }
46 }