Mercurial > dive4elements > river
diff gwt-client/src/test/java/test/sinfo/SinfoFloodDurationRiversideChoice.java @ 9422:e567fac95e3d
uinfo salix no scenario jUnit test
author | gernotbelger |
---|---|
date | Fri, 17 Aug 2018 11:43:42 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gwt-client/src/test/java/test/sinfo/SinfoFloodDurationRiversideChoice.java Fri Aug 17 11:43:42 2018 +0200 @@ -0,0 +1,97 @@ +/** 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 test.sinfo; + +/** + * @author Domenico Nardi Tironi + * + */ +final class SinfoFloodDurationRiversideChoice { + // THIS IS A COPY!!!! + + public enum RiversideChoiceKey { + NONE("", AttributeKey.NONE), // + LEFT("state.sinfo.riverside.left", AttributeKey.LEFT), // + RIGHT("state.sinfo.riverside.right", AttributeKey.RIGHT), // + BOTH("state.sinfo.riverside.both", AttributeKey.UNKNOWN); + + private final String key; + private final AttributeKey attributeKey; + + RiversideChoiceKey(final String key, final AttributeKey attributeKey) { + this.key = key; + this.attributeKey = attributeKey; + } + + public static RiversideChoiceKey fromKey(final String key) { + for (final RiversideChoiceKey v : values()) { + if (key.equalsIgnoreCase(v.key)) + return v; + } + return NONE; + } + + public String getKey() { + return this.key; + } + + public AttributeKey getAttributeKey() { + return this.attributeKey; + } + } + + /// THIS IS ALSO A COPY FROM org.dive4elements.river.model.Attribute (shortend, no DB-Queries) + + public enum AttributeKey { + NONE(""), STRECKE(">>>>>>>>>>>>>>>"), LEFT("links"), RIGHT("rechts"), UNKNOWN("?"); + + private final String name; + private int id; + private boolean ready; + + AttributeKey(final String name) { + this.name = name; + this.id = 0; + this.ready = false; + } + + /** + * Type name in the database + */ + public String getName() { + return this.name; + } + + /** + * Type id in the database + */ + public int getId() { + // initFromDatabase(); + return this.id; + } + + /** + * Set the type id + */ + public void setId(final int id) { + this.id = id; + } + + protected boolean getReady() { + return this.ready; + } + + protected void setReady(final boolean ready) { + this.ready = ready; + } + + } + +}