# HG changeset patch # User gernotbelger # Date 1523553436 -7200 # Node ID 209b10b144eca81cf27c96b6e652e15cf22fee81 # Parent 2dd58bbd292b5e3a7c91ecdcc1e8f62f72979957 Work on uinfo diff -r 2dd58bbd292b -r 209b10b144ec artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultRow.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultRow.java Thu Apr 12 19:17:03 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/** 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.common; - -import java.io.Serializable; -import java.util.EnumMap; -import java.util.Map; - -import org.dive4elements.artifacts.CallContext; - -/** - * Generic container for results that come in rows. - * - * @author Gernot Belger - */ -public final class SInfoResultRow implements Serializable { - private static final long serialVersionUID = 1L; - - private final Map values = new EnumMap<>(SInfoResultType.class); - - public static SInfoResultRow create() { - return new SInfoResultRow(); - } - - private SInfoResultRow() { - } - - public SInfoResultRow putValue(final SInfoResultType type, final Object value) { - - this.values.put(type, value); - - /* chain me */ - return this; - } - - public String exportValue(final CallContext context, final SInfoResultType type) { - final Object value = this.values.get(type); - return type.exportValue(context, value); - } - - public double getDoubleValue(final SInfoResultType type) { - final Object value = this.values.get(type); - return type.asDouble(value); - } - - public Object getValue(final SInfoResultType type) { - return this.values.get(type); - } -} \ No newline at end of file