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