1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.codehaus.plexus.metadata.ann;
18
19 import org.objectweb.asm.Type;
20
21
22
23
24 public class AnnEnum {
25
26 private final String desc;
27 private final String value;
28
29 public AnnEnum(String desc, String value) {
30 this.desc = desc;
31 this.value = value;
32 }
33
34 public String getDesc() {
35 return desc;
36 }
37
38 public String getValue() {
39 return value;
40 }
41
42 public String getType() {
43 return Type.getType(desc).getClassName();
44 }
45
46 public int hashCode() {
47 return 31 * (31 + desc.hashCode()) + value.hashCode();
48 }
49
50 public boolean equals(Object obj) {
51 if (this == obj) {
52 return true;
53 }
54 if (obj == null) {
55 return false;
56 }
57 if (getClass() != obj.getClass()) {
58 return false;
59 }
60 AnnEnum other = (AnnEnum) obj;
61 if (desc == null) {
62 if (other.desc != null) {
63 return false;
64 }
65 } else if (!desc.equals(other.desc)) {
66 return false;
67 }
68 if (value == null) {
69 if (other.value != null) {
70 return false;
71 }
72 } else if (!value.equals(other.value)) {
73 return false;
74 }
75 return true;
76 }
77 }