Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/util/BedHeightInfo.java @ 8894:a66f2a7c4f84
SINFO FlowDepth - slight code cleanup
author | gernotbelger |
---|---|
date | Thu, 15 Feb 2018 18:40:40 +0100 |
parents | artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/BedHeightInfo.java@7a8c12706834 |
children | 11bf13cf0463 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/util/BedHeightInfo.java Thu Feb 15 18:40:40 2018 +0100 @@ -0,0 +1,81 @@ +/** 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 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 Integer 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; + + + public static BedHeightInfo from(final BedHeight bedHeight) { + return new BedHeightInfo(bedHeight); + } + + private BedHeightInfo(final BedHeight bedHeight) { + this.year = bedHeight.getYear(); + 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(); + } + + public Integer 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; + } +}