comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/data/DefaultStateData.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/data/DefaultStateData.java@93a774fe2bb4
children 415df0fc4fa1
comparison
equal deleted inserted replaced
472:783cc1b6b615 473:d0ac790a6c89
1 /*
2 * Copyright (c) 2011 by Intevation GmbH
3 *
4 * This program is free software under the LGPL (>=v2.1)
5 * Read the file LGPL.txt coming with the software for details
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
7 */
8 package de.intevation.artifactdatabase.data;
9
10
11 /**
12 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
13 */
14 public class DefaultStateData implements StateData {
15
16 /** The name of the data. */
17 protected String name;
18
19 /** The description of the data. */
20 protected String description;
21
22 /** The type of the data. */
23 protected String type;
24
25 /** The value. */
26 protected Object value;
27
28 public DefaultStateData() {
29 }
30
31 /**
32 * The default constructor. It creates empty StateData objects with no
33 * value.
34 *
35 * @param name The name.
36 * @param description The description.
37 * @param type The type.
38 */
39 public DefaultStateData(String name, String description, String type) {
40 this.name = name;
41 this.description = description;
42 this.type = type;
43 }
44
45 public void set(StateData other) {
46 name = other.getName();
47 description = other.getDescription();
48 type = other.getType();
49 value = other.getValue();
50 }
51
52
53 /**
54 * A constructor that takes the name of the data, its value and the
55 * describing parameters description and type.
56 *
57 * @param name The name of the data item.
58 * @param description The description.
59 * @param type The type.
60 * @param value The value of the data item.
61 */
62 public DefaultStateData(
63 String name,
64 String description,
65 String type,
66 String value)
67 {
68 this.name = name;
69 this.description = description;
70 this.type = type;
71 this.value = value;
72 }
73
74
75 /**
76 * Returns the name of the data object.
77 *
78 * @return the name.
79 */
80 public String getName() {
81 return name;
82 }
83
84
85 /**
86 * Returns the description of the data object.
87 *
88 * @return the description of the data object.
89 */
90 public String getDescription() {
91 return description;
92 }
93
94
95 /**
96 * Returns the type of the data object as string.
97 *
98 * @return the type as string.
99 */
100 public String getType() {
101 return type;
102 }
103
104
105 /**
106 * Returns the value of the data object.
107 *
108 * @return the value.
109 */
110 public Object getValue() {
111 return value;
112 }
113
114
115 /**
116 * Set the value of this data object.
117 *
118 * @param value The new value for this data object.
119 */
120 public void setValue(Object value) {
121 this.value = value;
122 }
123
124 @Override
125 public StateData deepCopy() {
126 DefaultStateData copy = new DefaultStateData();
127 copy.set(this);
128 return copy;
129 }
130 }
131 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org