1 16 package scriptella.spi; 17 18 24 public class DialectIdentifier { 25 28 public static final DialectIdentifier NULL_DIALECT = new DialectIdentifier(null, null); 29 private String name; 30 private String version; 31 32 38 public DialectIdentifier(String name, String version) { 39 this.name = name; 40 this.version = version; 41 } 42 43 46 public String getName() { 47 return name; 48 } 49 50 53 public String getVersion() { 54 return version; 55 } 56 57 public boolean equals(final Object o) { 58 if (this == o) { 59 return true; 60 } 61 62 if (!(o instanceof DialectIdentifier)) { 63 return false; 64 } 65 66 final DialectIdentifier dialectIdentifier = (DialectIdentifier) o; 67 68 if ((name != null) ? (!name.equals(dialectIdentifier.name)) 69 : (dialectIdentifier.name != null)) { 70 return false; 71 } 72 73 return !((version != null) ? (!version.equals(dialectIdentifier.version)) 74 : (dialectIdentifier.version != null)); 75 76 } 77 78 public int hashCode() { 79 int result; 80 result = ((name != null) ? name.hashCode() : 0); 81 result = (29 * result) + ((version != null) ? version.hashCode() : 0); 82 83 return result; 84 } 85 86 public String toString() { 87 return "Dialect{" + name + ' ' + version + "}"; 88 } 89 } 90 | Popular Tags |