1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase;
19
20 import org.apache.hadoop.hbase.HealthChecker.HealthCheckerExitStatus;
21
22
23
24
25 class HealthReport {
26
27 private HealthCheckerExitStatus status;
28 private String healthReport;
29
30 HealthReport(HealthCheckerExitStatus status, String healthReport) {
31 super();
32 this.status = status;
33 this.healthReport = healthReport;
34 }
35
36
37
38
39
40
41 HealthCheckerExitStatus getStatus() {
42 return status;
43 }
44
45 @Override
46 public String toString() {
47 return this.status + " " + this.healthReport;
48 }
49
50
51
52
53
54
55 String getHealthReport() {
56 return healthReport;
57 }
58
59 @Override
60 public int hashCode() {
61 final int prime = 31;
62 int result = 1;
63 result = prime * result + ((healthReport == null) ? 0 : healthReport.hashCode());
64 result = prime * result + ((status == null) ? 0 : status.hashCode());
65 return result;
66 }
67
68 @Override
69 public boolean equals(Object obj) {
70 if (this == obj) {
71 return true;
72 }
73 if (obj == null) {
74 return false;
75 }
76 if (!(obj instanceof HealthReport)) {
77 return false;
78 }
79 HealthReport other = (HealthReport) obj;
80 if (healthReport == null) {
81 if (other.healthReport != null) {
82 return false;
83 }
84 } else if (!healthReport.equals(other.healthReport)) {
85 return false;
86 }
87 if (status != other.status) {
88 return false;
89 }
90 return true;
91 }
92 }