annotate flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/StaticSQCacheKey.java @ 5831:bd047b71ab37

Repaired internal references
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:06:39 +0200
parents flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/StaticSQCacheKey.java@700ac898ab0b
children
rev   line source
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5500
diff changeset
1 package org.dive4elements.river.artifacts.model.sq;
5500
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 }

http://dive4elements.wald.intevation.org