Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/StaticSQCacheKey.java @ 5726:17eba7d251b2
WQKmsFactory: Add name getting function if only column id is known.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 16 Apr 2013 12:38:50 +0200 |
parents | 700ac898ab0b |
children |
rev | line source |
---|---|
5500
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model.sq; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 public class StaticSQCacheKey |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 implements Serializable |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 public static final String CACHE_NAME = "static-sq-relation"; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 private String river; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 private int measurementId; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 public StaticSQCacheKey(String river, int measurementId) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 this.river = river; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 this.measurementId = measurementId; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 public int hashCode() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 return this.river.hashCode() | measurementId; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 public boolean equals(Object other) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 if (!(other instanceof StaticSQCacheKey)) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 return false; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 StaticSQCacheKey o = (StaticSQCacheKey) other; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 return this.river == o.river && this.measurementId == o.measurementId; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 } |