source: protocol/src/main/java/geniusweb/protocol/CurrentNegoState.java

Last change on this file was 52, checked in by ruud, 14 months ago

Fixed small issues in domaineditor.

File size: 1.1 KB
Line 
1package geniusweb.protocol;
2
3import geniusweb.events.CurrentState;
4
5/**
6 * Implementation of CurrentState event. This contains NegoState and therefore
7 * can not be defined in the events module.
8 */
9public class CurrentNegoState extends CurrentState {
10 private final NegoState state;
11
12 public CurrentNegoState(NegoState state) {
13 this.state = state;
14 }
15
16 public CurrentNegoState(NegoState state, Long now) {
17 super(now);
18 this.state = state;
19 }
20
21 public NegoState getState() {
22 return state;
23 }
24
25 @Override
26 public String toString() {
27 return "CurrentNegoState[" + getTime() + "," + state + "]";
28 }
29
30 @Override
31 public int hashCode() {
32 final int prime = 31;
33 int result = super.hashCode();
34 result = prime * result + ((state == null) ? 0 : state.hashCode());
35 return result;
36 }
37
38 @Override
39 public boolean equals(Object obj) {
40 if (this == obj)
41 return true;
42 if (!super.equals(obj))
43 return false;
44 if (getClass() != obj.getClass())
45 return false;
46 CurrentNegoState other = (CurrentNegoState) obj;
47 if (state == null) {
48 if (other.state != null)
49 return false;
50 } else if (!state.equals(other.state))
51 return false;
52 return true;
53 }
54}
Note: See TracBrowser for help on using the repository browser.