Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticSedimentLoadCacheKey.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticSedimentLoadCacheKey.java@bd047b71ab37 |
children | 4897a58c8746 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticSedimentLoadCacheKey.java Thu Apr 25 15:23:37 2013 +0200 @@ -0,0 +1,53 @@ +package org.dive4elements.river.artifacts.model; + +import org.apache.commons.lang.builder.HashCodeBuilder; + + +public class StaticSedimentLoadCacheKey +{ + public static final String CACHE_NAME = "sedimentload-value-table-static"; + + private String river; + private double startKm; + private double endKm; + private int sYear; + private int eYear; + + public StaticSedimentLoadCacheKey( + String river, + double startKm, + double endKm, + int sYear, + int eYear + ) { + this.river = river; + this.startKm = startKm; + this.endKm = endKm; + this.sYear = sYear; + this.eYear = eYear; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + builder.append(river); + builder.append(startKm); + builder.append(endKm); + builder.append(sYear); + builder.append(eYear); + return builder.toHashCode(); + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof StaticBedHeightCacheKey)) { + return false; + } + StaticSedimentLoadCacheKey o = (StaticSedimentLoadCacheKey) other; + return this.river == o.river && + this.startKm == o.startKm && + this.endKm == o.endKm && + this.sYear == o.sYear && + this.eYear == o.eYear; + } +}