1 |
| package net.sourceforge.pmd; |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| public final class SourceType { |
9 |
| public static final SourceType JAVA_13 = new SourceType("java 1.3"); |
10 |
| public static final SourceType JAVA_14 = new SourceType("java 1.4"); |
11 |
| public static final SourceType JAVA_15 = new SourceType("java 1.5"); |
12 |
| public static final SourceType JSP = new SourceType("jsp"); |
13 |
| |
14 |
| private String id; |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
804
| private SourceType(String id) {
|
22 |
804
| setId(id);
|
23 |
| } |
24 |
| |
25 |
8183
| public String getId() {
|
26 |
8183
| return id;
|
27 |
| } |
28 |
| |
29 |
804
| private void setId(String id) {
|
30 |
804
| this.id = id;
|
31 |
| } |
32 |
| |
33 |
3
| public boolean equals(Object other) {
|
34 |
3
| if (other == null) {
|
35 |
0
| return false;
|
36 |
| } |
37 |
| |
38 |
3
| if (other instanceof SourceType) {
|
39 |
3
| return ((SourceType) other).getId().equals(getId());
|
40 |
| } |
41 |
| |
42 |
0
| return false;
|
43 |
| } |
44 |
| |
45 |
8177
| public int hashCode() {
|
46 |
8177
| return getId().hashCode();
|
47 |
| } |
48 |
| |
49 |
| |
50 |
| |
51 |
| |
52 |
0
| public String toString() {
|
53 |
0
| return "SourceType [" + getId() + "]";
|
54 |
| } |
55 |
| } |