view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/map/StaticHWSCacheKey.java @ 5712:84e02b3f7a4f

Avoid NPE in sediment density factory and return a valid density if no exists.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 15 Apr 2013 17:04:38 +0200
parents ac2746f3e75f
children
line wrap: on
line source
package de.intevation.flys.artifacts.model.map;


public class StaticHWSCacheKey
{
    public static final String CACHE_NAME = "hws-value-table-static";

    private String river;
    private int type;

    public StaticHWSCacheKey(String river, int type) {
        this.river = river;
        this.type = type;
    }

    public int hashCode() {
        return river.hashCode() | (type << 8);
    }

    public boolean equals(Object other) {
        if (!(other instanceof StaticHWSCacheKey)) {
            return false;
        }
        StaticHWSCacheKey o = (StaticHWSCacheKey) other;
        return this.river == o.river;
    }
}

http://dive4elements.wald.intevation.org