1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.data.platform;
17
18 import org.apache.commons.lang.StringUtils;
19
20
21
22
23
24
25
26
27 public final class DatabasePlatformInfo {
28
29 private final String name;
30 private final int majorVersion;
31
32
33
34
35
36
37
38 public DatabasePlatformInfo(String name, int majorVersion) {
39 if (StringUtils.isBlank(name)) {
40 throw new IllegalArgumentException("Name cannot be null or blank");
41 }
42 this.name = name;
43 this.majorVersion = majorVersion;
44 }
45
46
47
48
49
50
51 public String getName() {
52 return name;
53 }
54
55
56
57
58
59
60 public int getMajorVersion() {
61 return majorVersion;
62 }
63
64
65
66
67 @Override
68 public boolean equals(Object object) {
69 if (this == object) {
70 return true;
71 }
72 if (!(object instanceof DatabasePlatformInfo)) {
73 return false;
74 }
75
76 final DatabasePlatformInfo that = (DatabasePlatformInfo) object;
77
78 if (!name.equals(that.name)) {
79 return false;
80 }
81 if (majorVersion != that.majorVersion) {
82 return false;
83 }
84
85 return true;
86 }
87
88
89
90
91 @Override
92 public int hashCode() {
93 int result = name.hashCode();
94 result = 31 * result + majorVersion;
95 return result;
96 }
97
98
99
100
101 @Override
102 public String toString() {
103 return "DatabasePlatformInfo{" +
104 "name='" + name + '\'' +
105 ", majorVersion=" + majorVersion +
106 '}';
107 }
108 }