Mercurial > dive4elements > river
comparison gwt-client/src/test/java/test/SinfoFloodDurationRiversideChoice.java @ 9418:9fe26f525ae3
sinfo floodduration jUnit test
author | gernotbelger |
---|---|
date | Thu, 16 Aug 2018 18:15:54 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9417:46e3e23cca0b | 9418:9fe26f525ae3 |
---|---|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package test; | |
11 | |
12 /** | |
13 * @author Domenico Nardi Tironi | |
14 * | |
15 */ | |
16 public class SinfoFloodDurationRiversideChoice { | |
17 // THIS IS A COPY!!!! | |
18 | |
19 public enum RiversideChoiceKey { | |
20 NONE("", AttributeKey.NONE), // | |
21 LEFT("state.sinfo.riverside.left", AttributeKey.LEFT), // | |
22 RIGHT("state.sinfo.riverside.right", AttributeKey.RIGHT), // | |
23 BOTH("state.sinfo.riverside.both", AttributeKey.UNKNOWN); | |
24 | |
25 private final String key; | |
26 private final AttributeKey attributeKey; | |
27 | |
28 RiversideChoiceKey(final String key, final AttributeKey attributeKey) { | |
29 this.key = key; | |
30 this.attributeKey = attributeKey; | |
31 } | |
32 | |
33 public static RiversideChoiceKey fromKey(final String key) { | |
34 for (final RiversideChoiceKey v : values()) { | |
35 if (key.equalsIgnoreCase(v.key)) | |
36 return v; | |
37 } | |
38 return NONE; | |
39 } | |
40 | |
41 public String getKey() { | |
42 return this.key; | |
43 } | |
44 | |
45 public AttributeKey getAttributeKey() { | |
46 return this.attributeKey; | |
47 } | |
48 } | |
49 | |
50 /// THIS IS ALSO A COPY FROM org.dive4elements.river.model.Attribute (shortend, no DB-Queries) | |
51 | |
52 public enum AttributeKey { | |
53 NONE(""), STRECKE(">>>>>>>>>>>>>>>"), LEFT("links"), RIGHT("rechts"), UNKNOWN("?"); | |
54 | |
55 private final String name; | |
56 private int id; | |
57 private boolean ready; | |
58 | |
59 AttributeKey(final String name) { | |
60 this.name = name; | |
61 this.id = 0; | |
62 this.ready = false; | |
63 } | |
64 | |
65 /** | |
66 * Type name in the database | |
67 */ | |
68 public String getName() { | |
69 return this.name; | |
70 } | |
71 | |
72 /** | |
73 * Type id in the database | |
74 */ | |
75 public int getId() { | |
76 // initFromDatabase(); | |
77 return this.id; | |
78 } | |
79 | |
80 /** | |
81 * Set the type id | |
82 */ | |
83 public void setId(final int id) { | |
84 this.id = id; | |
85 } | |
86 | |
87 protected boolean getReady() { | |
88 return this.ready; | |
89 } | |
90 | |
91 protected void setReady(final boolean ready) { | |
92 this.ready = ready; | |
93 } | |
94 | |
95 } | |
96 | |
97 } |