comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultOutput.java @ 473:d0ac790a6c89 dive4elements-move

Moved directories to org.dive4elements
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 10:57:18 +0200
parents artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultOutput.java@f2eab30cbc9a
children 415df0fc4fa1
comparison
equal deleted inserted replaced
472:783cc1b6b615 473:d0ac790a6c89
1 package de.intevation.artifactdatabase.state;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 /**
7 * The default implementation of an Output.
8 *
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
10 */
11 public class DefaultOutput implements Output {
12
13 protected String name;
14
15 protected String description;
16
17 protected String mimeType;
18
19 protected String type;
20
21 protected List<Facet> facets;
22
23 protected Settings settings;
24
25
26 /**
27 * The default constructor that instantiates a new DefaultOutput object.
28 *
29 * @param name The name of this output.
30 * @param description The description of this output.
31 * @param mimeType The mimetype of this output.
32 */
33 public DefaultOutput(String name, String description, String mimeType) {
34 this.name = name;
35 this.description = description;
36 this.mimeType = mimeType;
37 this.type = "";
38 this.facets = new ArrayList<Facet>();
39 }
40
41
42 public DefaultOutput(
43 String name,
44 String description,
45 String mimeType,
46 String type)
47 {
48 this(name, description, mimeType);
49
50 this.facets = new ArrayList<Facet>();
51 this.type = type;
52 }
53
54
55 public DefaultOutput(
56 String name,
57 String description,
58 String mimeType,
59 List<Facet> facets)
60 {
61 this(name, description, mimeType);
62
63 this.type = "";
64 this.facets = facets;
65 }
66
67
68 /**
69 * This constructor builds a new Output object that contains facets as well.
70 *
71 * @param name The name of this output.
72 * @param description The description of this output.
73 * @param mimeType The mimetype of this output.
74 * @param facets The list of facets supported by this output.
75 * @param type The type of the Output e.g. chart
76 */
77 public DefaultOutput(
78 String name,
79 String description,
80 String mimeType,
81 List<Facet> facets,
82 String type)
83 {
84 this(name, description, mimeType, facets);
85
86 this.type = type;
87 }
88
89
90 /**
91 * Returns the name of this output.
92 *
93 * @return the name of this output.
94 */
95 public String getName() {
96 return name;
97 }
98
99
100 /**
101 * Returns the description of this output.
102 *
103 * @return the description of this output.
104 */
105 public String getDescription() {
106 return description;
107 }
108
109
110 /**
111 * Returns the mimetype of this output.
112 *
113 * @return the mimetype of this output.
114 */
115 public String getMimeType() {
116 return mimeType;
117 }
118
119
120 public String getType() {
121 return type;
122 }
123
124
125 /**
126 * Returns the list of facets supported by this output.
127 *
128 * @return the list of facets supported by this output.
129 */
130 public List<Facet> getFacets() {
131 return facets;
132 }
133
134
135 public void addFacet(Facet facet) {
136 if (facet != null && !facets.contains(facet)) {
137 facets.add(facet);
138 }
139 }
140
141
142 public void addFacets(List<Facet> facets) {
143 this.facets.addAll(facets);
144 }
145
146
147 @Override
148 public void setFacets(List<Facet> facets) {
149 this.facets = facets;
150 }
151
152
153 @Override
154 public void setSettings(Settings settings) {
155 this.settings = settings;
156 }
157
158
159 @Override
160 public Settings getSettings() {
161 return settings;
162 }
163 }
164 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org