Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/util/BedHeightInfo.java @ 9268:ae9dee74e43e
Fixed: current station of duration chart was not changed
author | gernotbelger |
---|---|
date | Wed, 18 Jul 2018 18:53:15 +0200 |
parents | 6a1580b38e7d |
children | b9c87bbff6a4 |
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde * Software engineering by * Björnsen Beratende Ingenieure GmbH * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * 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.sinfo.util; import java.io.Serializable; import java.math.BigDecimal; import org.dive4elements.river.model.BedHeight; /** * Basic infos about a {@link BedHeight}. * * @author Gernot Belger */ public final class BedHeightInfo implements Serializable { private static final long serialVersionUID = 1L; private final int year; private final String description; private final String type; private final String evaluationBy; private final String locationSystem; private final String curElevationModelUnit; private final String oldElevationModelUnit; private final BigDecimal from; private final BigDecimal to; public static BedHeightInfo from(final BedHeight bedHeight) { return new BedHeightInfo(bedHeight); } private BedHeightInfo(final BedHeight bedHeight) { final Integer bhYear = bedHeight.getYear(); if (bhYear == null) { // REMARK: this should never happen, as we do not allow the user to select bed heights without a year information throw new IllegalArgumentException("bedHeight has no year"); } this.year = bhYear; this.description = bedHeight.getDescription(); this.type = bedHeight.getType().getName(); this.evaluationBy = bedHeight.getEvaluationBy(); this.locationSystem = bedHeight.getLocationSystem().getName(); this.curElevationModelUnit = bedHeight.getCurElevationModel().getUnit().getName(); this.oldElevationModelUnit = bedHeight.getCurElevationModel().getUnit().getName(); this.from = bedHeight.getRange().getA(); this.to = bedHeight.getRange().getB(); } public int getYear() { return this.year; } public String getDescription() { return this.description; } public String getType() { return this.type; } public String getEvaluationBy() { return this.evaluationBy; } public String getLocationSystem() { return this.locationSystem; } public String getCurElevationModelUnit() { return this.curElevationModelUnit; } public String getOldElevationModelUnit() { return this.oldElevationModelUnit; } public BigDecimal getFrom() { return this.from; } public BigDecimal getTo() { return this.to; } }