Fixed: malfunctioned "Remove trailing spaces on editor save"
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.ui / src / net / sourceforge / phpeclipse / xdebug / ui / EnvironmentVariable.java
1 package net.sourceforge.phpeclipse.xdebug.ui;
2
3 /**
4  * A key/value set whose data is passed into Runtime.exec(...)
5  */
6 public class EnvironmentVariable {
7         // The name of the environment variable
8         private String name;
9
10         // The value of the environment variable
11         private String value;
12
13         public EnvironmentVariable(String name, String value) {
14                 this.name = name;
15                 this.value = value;
16         }
17
18         /**
19          * Returns this variable's name, which serves as the key in the key/value
20          * pair this variable represents
21          * 
22          * @return this variable's name
23          */
24         public String getName() {
25                 return name;
26         }
27
28         /**
29          * Returns this variables value.
30          * 
31          * @return this variable's value
32          */
33         public String getValue() {
34                 return value;
35         }
36
37         /**
38          * Sets this variable's value
39          * 
40          * @param value
41          */
42         public void setValue(String value) {
43                 this.value = value;
44         }
45
46         /*
47          * (non-Javadoc)
48          * 
49          * @see java.lang.Object#toString()
50          */
51         public String toString() {
52                 return getName();
53         }
54
55         /*
56          * (non-Javadoc)
57          * 
58          * @see java.lang.Object#equals(java.lang.Object)
59          */
60         public boolean equals(Object obj) {
61                 boolean equal = false;
62                 if (obj instanceof EnvironmentVariable) {
63                         EnvironmentVariable var = (EnvironmentVariable) obj;
64                         equal = var.getName().equals(name);
65                 }
66                 return equal;
67         }
68
69         /*
70          * (non-Javadoc)
71          * 
72          * @see java.lang.Object#hashCode()
73          */
74         public int hashCode() {
75                 return name.hashCode();
76         }
77 }