View Javadoc

1   /*
2    * Copyright 2010 Capgemini and Contributors
3    *
4    * Licensed under the Apache License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package net.sf.appstatus.core.check.impl;
17  
18  import org.apache.commons.lang3.ObjectUtils;
19  
20  import net.sf.appstatus.core.check.ICheckResult;
21  
22  /**
23   * Default Status check result.
24   *
25   * @author Nicolas Richeton
26   *
27   */
28  public class StatusResultImpl implements ICheckResult {
29  	private int code;
30  	private String description;
31  	private boolean fatal;
32  	private String group;
33  	private String probeName;
34  	private String resolutionSteps;
35  
36  	public int compareTo(ICheckResult otherResult) {
37  		int groupCompare = ObjectUtils.compare(group, otherResult.getGroup());
38  		if (groupCompare != 0) {
39  			return groupCompare;
40  		}
41  
42  		return ObjectUtils.compare(probeName, otherResult.getProbeName());
43  	}
44  
45  	public int getCode() {
46  		return code;
47  	}
48  
49  	public String getDescription() {
50  		return description;
51  	}
52  
53  	public String getGroup() {
54  		return group;
55  	}
56  
57  	public String getProbeName() {
58  		return probeName;
59  	}
60  
61  	public String getResolutionSteps() {
62  		return resolutionSteps;
63  	}
64  
65  	public boolean isFatal() {
66  		return fatal;
67  	}
68  
69  	public void setCode(int code) {
70  		this.code = code;
71  	}
72  
73  	public void setDescription(String description) {
74  		this.description = description;
75  	}
76  
77  	public void setFatal(boolean fatal) {
78  		this.fatal = fatal;
79  	}
80  
81  	public void setGroup(String group) {
82  		this.group = group;
83  	}
84  
85  	public void setProbeName(String probeName) {
86  		this.probeName = probeName;
87  	}
88  
89  	public void setResolutionSteps(String resolutionSteps) {
90  		this.resolutionSteps = resolutionSteps;
91  	}
92  }