# HG changeset patch # User Raimund Renkert # Date 1398864484 -7200 # Node ID 6e346ef4446fff7b75cba976df59786d5ede6ddd # Parent b566cd0c025a7e8fb784db6abf7194340e4ddf27 Added cache key class for porosity. diff -r b566cd0c025a -r 6e346ef4446f artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticPorosityCacheKey.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticPorosityCacheKey.java Wed Apr 30 15:28:04 2014 +0200 @@ -0,0 +1,37 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.artifacts.model; + + +public class StaticPorosityCacheKey +{ + public static final String CACHE_NAME = "porosity-table-static"; + + private int porosity_id; + + public StaticPorosityCacheKey( + int porosity_id + ) { + this.porosity_id = porosity_id; + } + + @Override + public int hashCode() { + return (String.valueOf(porosity_id)).hashCode(); + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof StaticPorosityCacheKey)) { + return false; + } + StaticPorosityCacheKey o = (StaticPorosityCacheKey) other; + return this.porosity_id == o.porosity_id; + } +}