1
2
3
4
5
6
7 package nl.mineleni.cbsviewer.servlet.wms.cache;
8
9 import nl.mineleni.cbsviewer.util.xml.LayerDescriptor;
10
11 import org.opengis.geometry.BoundingBox;
12
13
14
15
16
17
18
19 public class BboxLayerCacheKey {
20
21
22 private final BoundingBox bbox;
23
24 private final LayerDescriptor ld;
25
26
27
28
29
30
31
32
33
34 public BboxLayerCacheKey(final BoundingBox bbox, final LayerDescriptor ld) {
35 this.bbox = bbox;
36 this.ld = ld;
37 }
38
39
40
41
42
43
44 @Override
45 public boolean equals(final Object obj) {
46 if (this == obj) {
47 return true;
48 }
49 if (obj == null) {
50 return false;
51 }
52 if (getClass() != obj.getClass()) {
53 return false;
54 }
55 final BboxLayerCacheKey other = (BboxLayerCacheKey) obj;
56 if (bbox == null) {
57 if (other.bbox != null) {
58 return false;
59 }
60 } else if (!bbox.equals(other.bbox)) {
61 return false;
62 }
63 if (ld == null) {
64 if (other.ld != null) {
65 return false;
66 }
67 } else if (!ld.equals(other.ld)) {
68 return false;
69 }
70 return true;
71 }
72
73
74
75
76
77
78 public BoundingBox getBbox() {
79 return bbox;
80 }
81
82
83
84
85
86
87 public LayerDescriptor getLd() {
88 return ld;
89 }
90
91
92
93
94
95
96 @Override
97 public int hashCode() {
98 final int prime = 31;
99 int result = 1;
100 result = prime * result + ((bbox == null) ? 0 : bbox.hashCode());
101 result = prime * result + ((ld == null) ? 0 : ld.hashCode());
102 return result;
103 }
104 }