source: events/src/main/java/geniusweb/events/SessionStarted.java@ 32

Last change on this file since 32 was 32, checked in by bart, 3 years ago

Multiple learns with repeated tournament, maven use https.

File size: 1.7 KB
Line 
1package geniusweb.events;
2
3import java.util.List;
4
5import com.fasterxml.jackson.annotation.JsonCreator;
6import com.fasterxml.jackson.annotation.JsonProperty;
7import com.fasterxml.jackson.annotation.JsonTypeName;
8
9import geniusweb.actions.PartyId;
10
11@JsonTypeName("sessionstarted")
12public class SessionStarted extends ProtocolEvent {
13 private Long sessionNumber;
14 private List<PartyId> parties;
15
16 @JsonCreator
17 public SessionStarted(@JsonProperty("sessionNumber") Long sessionnr,
18 @JsonProperty("parties") List<PartyId> parties,
19 @JsonProperty("time") Long time) {
20 super(time);
21 this.sessionNumber = sessionnr;
22 this.parties = parties;
23 }
24
25 public List<PartyId> getParties() {
26 return parties;
27 }
28
29 public Long getSessionNumber() {
30 return sessionNumber;
31 }
32
33 @Override
34 public int hashCode() {
35 final int prime = 31;
36 int result = super.hashCode();
37 result = prime * result + ((parties == null) ? 0 : parties.hashCode());
38 result = prime * result
39 + ((sessionNumber == null) ? 0 : sessionNumber.hashCode());
40 return result;
41 }
42
43 @Override
44 public boolean equals(Object obj) {
45 if (this == obj)
46 return true;
47 if (!super.equals(obj))
48 return false;
49 if (getClass() != obj.getClass())
50 return false;
51 SessionStarted other = (SessionStarted) obj;
52 if (parties == null) {
53 if (other.parties != null)
54 return false;
55 } else if (!parties.equals(other.parties))
56 return false;
57 if (sessionNumber == null) {
58 if (other.sessionNumber != null)
59 return false;
60 } else if (!sessionNumber.equals(other.sessionNumber))
61 return false;
62 return true;
63 }
64
65 @Override
66 public String toString() {
67 return "SessionStarted[" + sessionNumber + "," + parties + ","
68 + getTime() + "]";
69 }
70
71}
Note: See TracBrowser for help on using the repository browser.