View Javadoc

1   package ca.uhn.hl7v2.testpanel.api;
2   
3   import org.apache.commons.lang.builder.EqualsBuilder;
4   import org.apache.commons.lang.builder.HashCodeBuilder;
5   import org.apache.commons.lang.builder.ToStringBuilder;
6   
7   public class WorkingStatusBean {
8   
9   	private String myMessage;
10  	private StatusEnum myStatus;
11  	
12  	public WorkingStatusBean() {
13  		super();
14  	}
15  	
16  
17  	public WorkingStatusBean(String theMessage, StatusEnum theStatus) {
18  		super();
19  		myMessage = theMessage;
20  		myStatus = theStatus;
21  	}
22  
23  
24  	@Override
25  	public boolean equals(Object theObj) {
26  		if (!(theObj instanceof WorkingStatusBean)) {
27  			return false;
28  		}
29  		WorkingStatusBean sb = ((WorkingStatusBean)theObj);
30  		return new EqualsBuilder().append(myMessage, sb.myMessage).append(myStatus, sb.myStatus).isEquals();
31  	}
32  
33  	/**
34  	 * @return the message
35  	 */
36  	public String getMessage() {
37  		return myMessage;
38  	}
39  
40  	/**
41  	 * @return the status
42  	 */
43  	public StatusEnum getStatus() {
44  		return myStatus;
45  	}
46  
47  	@Override
48  	public int hashCode() {
49  		return new HashCodeBuilder().append(myMessage).append(myStatus).toHashCode();
50  	}
51  
52  	/**
53  	 * @param theMessage the message to set
54  	 */
55  	public void setMessage(String theMessage) {
56  		myMessage = theMessage;
57  	}
58  
59  	/**
60  	 * @param theStatus the status to set
61  	 */
62  	public void setStatus(StatusEnum theStatus) {
63  		myStatus = theStatus;
64  	}
65  
66  	@Override
67  	public String toString() {
68  		return ToStringBuilder.reflectionToString(this);
69  	}
70  
71  	public enum StatusEnum{
72  		ERROR,
73  		OK,
74  		WORKING
75  	}
76  
77  }