hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Property.java
changeset 1497 cd3234c89e59
parent 766 d3e5868ddb33
child 5547 f4b087cbb361
equal deleted inserted replaced
1496:3fd9157e5e3c 1497:cd3234c89e59
    30  * @author Thomas Wuerthinger
    30  * @author Thomas Wuerthinger
    31  */
    31  */
    32 public class Property implements Serializable {
    32 public class Property implements Serializable {
    33 
    33 
    34     public static final long serialVersionUID = 1L;
    34     public static final long serialVersionUID = 1L;
       
    35 
    35     private String name;
    36     private String name;
    36     private String value;
    37     private String value;
    37 
    38 
    38     public Property() {
    39     private Property() {
    39         this(null, null);
    40         this(null, null);
    40     }
    41     }
    41 
    42 
    42     public Property(Property p) {
    43     private Property(Property p) {
    43         this(p.getName(), p.getValue());
    44         this(p.getName(), p.getValue());
    44     }
    45     }
    45 
    46 
    46     public Property(String name) {
    47     private Property(String name) {
    47         this(name, null);
    48         this(name, null);
    48     }
    49     }
    49 
    50 
    50     public Property(String name, String value) {
    51     public Property(String name, String value) {
    51         this.name = name;
    52         this.name = name;
    58 
    59 
    59     public String getValue() {
    60     public String getValue() {
    60         return value;
    61         return value;
    61     }
    62     }
    62 
    63 
    63     public void setName(String s) {
       
    64         this.name = s;
       
    65     }
       
    66 
       
    67     public void setValue(String s) {
       
    68         this.value = s;
       
    69     }
       
    70 
       
    71     @Override
    64     @Override
    72     public String toString() {
    65     public String toString() {
    73         return name + " = " + value + "; ";
    66         return name + " = " + value + "; ";
    74     }
    67     }
       
    68 
       
    69     @Override
       
    70     public boolean equals(Object o) {
       
    71         if (!(o instanceof Property)) return false;
       
    72         Property p2 = (Property)o;
       
    73         return name.equals(p2.name) && value.equals(p2.value);
       
    74     }
       
    75     @Override
       
    76     public int hashCode() {
       
    77         return name.hashCode() + value == null ? 0 : value.hashCode();
       
    78     }
    75 }
    79 }