1 19 package org.netbeans.api.java.platform; 20 21 import org.openide.modules.SpecificationVersion; 22 23 26 public class Profile { 27 28 private String name; 29 private SpecificationVersion version; 30 31 36 public Profile (String name, SpecificationVersion version) { 37 this.name = name; 38 this.version = version; 39 } 40 41 45 public final String getName () { 46 return this.name; 47 } 48 49 53 public final SpecificationVersion getVersion () { 54 return this.version; 55 } 56 57 58 public int hashCode () { 59 int hc = 0; 60 if (name != null) 61 hc = name.hashCode() << 16; 62 if (version != null) 63 hc += version.hashCode(); 64 return hc; 65 } 66 67 public boolean equals (Object other) { 68 if (other instanceof Profile) { 69 Profile op = (Profile) other; 70 return this.name == null ? op.name == null : this.name.equals(op.name) && 71 this.version == null ? op.version == null : this.version.equals (op.version); 72 } 73 else 74 return false; 75 } 76 77 public String toString () { 78 String str; 79 str = this.name == null ? "" : this.name; 80 str += " " + this.version == null ? "" : this.version.toString(); return str; 82 } 83 } 84 | Popular Tags |