1 package uk.ac.ebi.intenz.domain.enzyme;
2
3 import java.util.List;
4
5
6
7
8
9
10
11
12
13 public class EnzymeSubSubclass {
14 private EnzymeCommissionNumber ec;
15
16 private String className;
17
18 private String subclassName;
19
20 private String name;
21
22 private String description;
23
24 private List<EnzymeEntry> entries;
25
26
27
28
29
30
31
32
33
34
35
36
37
38 public EnzymeSubSubclass(EnzymeCommissionNumber ec, String className, String subclassName, String name,
39 String description, List<EnzymeEntry> entries) {
40 if (ec == null || className == null || subclassName == null)
41 throw new NullPointerException("No parameter must be 'null'.");
42 this.ec = ec;
43 this.className = className;
44 this.subclassName = subclassName;
45 this.name = name != null ? name : "";
46 this.description = description != null ? description : "";
47 this.entries = entries;
48 }
49
50
51
52
53
54
55
56
57 public int compareTo(Object o) {
58 if (o == null) throw new NullPointerException("Parameter 'o' must not be null.");
59 EnzymeSubSubclass enzymeSubSubclass = (EnzymeSubSubclass) o;
60 return ec.compareTo(enzymeSubSubclass.getEc());
61 }
62
63
64
65
66
67
68
69 public boolean equals(Object o) {
70 if (this == o) return true;
71 if (!(o instanceof EnzymeSubSubclass)) return false;
72
73 final EnzymeSubSubclass enzymeSubSubclass = (EnzymeSubSubclass) o;
74
75 if (className != null ? !className.equals(enzymeSubSubclass.className) : enzymeSubSubclass.className != null) return false;
76 if (description != null ? !description.equals(enzymeSubSubclass.description) : enzymeSubSubclass.description != null) return false;
77 if (ec != null ? !ec.equals(enzymeSubSubclass.ec) : enzymeSubSubclass.ec != null) return false;
78 if (entries != null ? !entries.equals(enzymeSubSubclass.entries) : enzymeSubSubclass.entries != null) return false;
79 if (name != null ? !name.equals(enzymeSubSubclass.name) : enzymeSubSubclass.name != null) return false;
80 if (subclassName != null ? !subclassName.equals(enzymeSubSubclass.subclassName) : enzymeSubSubclass.subclassName != null) return false;
81
82 return true;
83 }
84
85
86
87
88
89
90 public int hashCode() {
91 int result;
92 result = (ec != null ? ec.hashCode() : 0);
93 result = 29 * result + (className != null ? className.hashCode() : 0);
94 result = 29 * result + (subclassName != null ? subclassName.hashCode() : 0);
95 result = 29 * result + (name != null ? name.hashCode() : 0);
96 result = 29 * result + (description != null ? description.hashCode() : 0);
97 result = 29 * result + (entries != null ? entries.hashCode() : 0);
98 return result;
99 }
100
101
102
103
104 public EnzymeCommissionNumber getEc() {
105 return ec;
106 }
107
108 public String getClassName() {
109 return className;
110 }
111
112 public String getSubclassName() {
113 return subclassName;
114 }
115
116 public String getName() {
117 return name;
118 }
119
120 public String getDescription() {
121 return description;
122 }
123
124 public List<EnzymeEntry> getEntries() {
125 return entries;
126 }
127 }