1 package xdoclet;
2
3 /***
4 * Holds name=value pair. It is analog to XDoclet 1.2's configParameter, but it has the
5 * same "look and feel" as a classical Ant property. Can of course be used outside Ant.
6 *
7 * @author <a href="mailto:aslak.hellesoy at bekk.no">Aslak Hellesøy</a>
8 * @version $Revision: 1.7 $
9 */
10 public class Property {
11 private String _name;
12 private String _value;
13
14 /***
15 * Constructs a new property. Empty constructor is needed
16 * by Ant to create dynamic properties.
17 */
18 public Property() {
19 }
20
21 /***
22 * Constructs a new property.
23 *
24 * @param name the name of the property
25 * @param value the value of the property
26 */
27 public Property(String name, String value) {
28 setName(name);
29 setValue(value);
30 }
31
32 public boolean equals(Object o) {
33 if (this == o) {
34 return true;
35 }
36
37 if (!(o instanceof Property)) {
38 return false;
39 }
40
41 final Property property = (Property) o;
42
43 if ((_name != null) ? (!_name.equals(property._name)) : (property._name != null)) {
44 return false;
45 }
46
47 if ((_value != null) ? (!_value.equals(property._value)) : (property._value != null)) {
48 return false;
49 }
50
51 return true;
52 }
53
54 public int hashCode() {
55 int result;
56
57 result = ((_name != null) ? _name.hashCode() : 0);
58 result = (29 * result) + ((_value != null) ? _value.hashCode() : 0);
59
60 return result;
61 }
62
63 /***
64 * Gets the name of the property.
65 * @return the name of the property
66 */
67 public String getName() {
68 return _name;
69 }
70
71 /***
72 * Sets the name of the property.
73 * @param name the name of the property
74 */
75 public void setName(String name) {
76 _name = name;
77 }
78
79 /***
80 * Gets the value of the property.
81 * @return the value of the property
82 */
83 public String getValue() {
84 return _value;
85 }
86
87 /***
88 * Sets the value of the property.
89 * @param value the value of the property
90 */
91 public void setValue(String value) {
92 _value = value;
93 }
94
95 public String toString() {
96 return "[" + _name + "," + _value + "]";
97 }
98 }
This page was automatically generated by Maven