Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/MultiDataItem.java @ 7821:5c80f419aea4 minfo-opt
Added new state data type.
The new datatype takes a set of additional attributes and stores them to a
map.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 20 Mar 2014 13:32:43 +0100 |
parents | |
children | a805211690f7 |
comparison
equal
deleted
inserted
replaced
7819:b468dc65154a | 7821:5c80f419aea4 |
---|---|
1 package org.dive4elements.river.client.shared.model; | |
2 | |
3 import java.util.Map; | |
4 | |
5 | |
6 public class MultiDataItem | |
7 implements DataItem | |
8 { | |
9 /** The label. */ | |
10 protected String label; | |
11 | |
12 /** The description. */ | |
13 protected String description; | |
14 | |
15 /** The value. */ | |
16 protected Map<String, String> value; | |
17 | |
18 | |
19 public MultiDataItem() { | |
20 } | |
21 | |
22 /** | |
23 * The default constructor to create new instances. | |
24 * | |
25 * @param label The label. | |
26 * @param description The description. | |
27 * @param value The value. | |
28 */ | |
29 public MultiDataItem( | |
30 String label, | |
31 String description, | |
32 Map<String, String> value | |
33 ) { | |
34 this.label = label; | |
35 this.description = description; | |
36 this.value = value; | |
37 } | |
38 | |
39 | |
40 public String getLabel() { | |
41 return label; | |
42 } | |
43 | |
44 | |
45 public String getDescription() { | |
46 return description; | |
47 } | |
48 | |
49 | |
50 public String getStringValue() { | |
51 String v = ""; | |
52 for (Map.Entry<String, String> e: value.entrySet()) { | |
53 v += e.getKey() + ":" + e.getValue() + ";"; | |
54 } | |
55 return v; | |
56 } | |
57 | |
58 public Map<String, String> getValue() { | |
59 return value; | |
60 } | |
61 } |