view artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticPorosityCacheKey.java @ 7852:6e346ef4446f

Added cache key class for porosity.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 30 Apr 2014 15:28:04 +0200
parents
children 92a2b9b691e1
line wrap: on
line source
/* 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;
    }
}

http://dive4elements.wald.intevation.org