Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultCollectionItem.java @ 9499:853f2dafc16e
VegetationZones in CrossSectionsDiagram
author | gernotbelger |
---|---|
date | Thu, 27 Sep 2018 18:06:26 +0200 |
parents | ea9eef426962 |
children |
comparison
equal
deleted
inserted
replaced
9496:d8e753d0fdb9 | 9499:853f2dafc16e |
---|---|
9 package org.dive4elements.river.client.shared.model; | 9 package org.dive4elements.river.client.shared.model; |
10 | 10 |
11 import java.util.List; | 11 import java.util.List; |
12 import java.util.Map; | 12 import java.util.Map; |
13 | 13 |
14 | |
15 /** | 14 /** |
16 * The default implementation of a CollectionItem (artifact). | 15 * The default implementation of a CollectionItem (artifact). |
17 * | 16 * |
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
19 */ | 18 */ |
20 public class DefaultCollectionItem implements CollectionItem { | 19 public class DefaultCollectionItem implements CollectionItem { |
20 | |
21 private static final long serialVersionUID = 1L; | |
21 | 22 |
22 /** The identifier that specifies the artifact related to this item. */ | 23 /** The identifier that specifies the artifact related to this item. */ |
23 protected String identifier; | 24 protected String identifier; |
24 | 25 |
25 /** The hash that specifies the artifact related to this item. */ | 26 /** The hash that specifies the artifact related to this item. */ |
29 protected List<OutputMode> outputModes; | 30 protected List<OutputMode> outputModes; |
30 | 31 |
31 /** The map of datanames to data values. */ | 32 /** The map of datanames to data values. */ |
32 protected Map<String, String> data; | 33 protected Map<String, String> data; |
33 | 34 |
34 | |
35 /** | 35 /** |
36 * An empty constructor. | 36 * An empty constructor. |
37 */ | 37 */ |
38 public DefaultCollectionItem() { | 38 public DefaultCollectionItem() { |
39 } | 39 } |
40 | 40 |
41 | |
42 /** | 41 /** |
43 * The default constructor to create a new CollectionItem related to an | 42 * The default constructor to create a new CollectionItem related to an |
44 * artifact with output modes. | 43 * artifact with output modes. |
45 * | 44 * |
46 * @param identifier The identifier of an artifact. | 45 * @param identifier |
47 * @param outputModes The output modes supported by this item. | 46 * The identifier of an artifact. |
47 * @param outputModes | |
48 * The output modes supported by this item. | |
48 */ | 49 */ |
49 public DefaultCollectionItem( | 50 public DefaultCollectionItem(final String identifier, final String hash, final List<OutputMode> modes, final Map<String, String> data) { |
50 String identifier, | 51 this.identifier = identifier; |
51 String hash, | 52 this.hash = hash; |
52 List<OutputMode> modes, | |
53 Map<String,String> data | |
54 ) { | |
55 this.identifier = identifier; | |
56 this.hash = hash; | |
57 this.outputModes = modes; | 53 this.outputModes = modes; |
58 this.data = data; | 54 this.data = data; |
59 } | 55 } |
60 | 56 |
61 | 57 @Override |
62 | |
63 public String identifier() { | 58 public String identifier() { |
64 return identifier; | 59 return this.identifier; |
65 } | 60 } |
66 | 61 |
67 | 62 @Override |
68 public String hash() { | 63 public String hash() { |
69 return hash; | 64 return this.hash; |
70 } | 65 } |
71 | 66 |
72 | 67 @Override |
73 public List<OutputMode> getOutputModes() { | 68 public List<OutputMode> getOutputModes() { |
74 return outputModes; | 69 return this.outputModes; |
75 } | 70 } |
76 | 71 |
77 | 72 @Override |
78 public List<Facet> getFacets(String outputmode) { | 73 public List<Facet> getFacets(final String outputmode) { |
79 for (OutputMode mode: outputModes) { | 74 for (final OutputMode mode : this.outputModes) { |
80 if (outputmode.equals(mode.getName())) { | 75 if (outputmode.equals(mode.getName())) { |
81 // TODO Return facets, but facets are not implemented for | 76 // TODO Return facets, but facets are not implemented for |
82 // OutputModes yet! | 77 // OutputModes yet! |
83 } | 78 } |
84 } | 79 } |
85 | 80 |
86 return null; | 81 return null; |
87 } | 82 } |
88 | 83 |
89 | |
90 /** | 84 /** |
91 * Returns artifact data. | 85 * Returns artifact data. |
86 * | |
92 * @return key/value data map | 87 * @return key/value data map |
93 */ | 88 */ |
89 @Override | |
94 public Map<String, String> getData() { | 90 public Map<String, String> getData() { |
95 return this.data; | 91 return this.data; |
96 } | 92 } |
97 } | 93 } |
98 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 94 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |