package geniusweb.events; public class TournamentStarted extends ProtocolEvent { private Long numberOfSessions; @SuppressWarnings("unused") // deserialization private TournamentStarted() { numberOfSessions = null; } /** * * @param numberOfSessions the total number of sessions in the tournament */ public TournamentStarted(Long numberOfSessions) { this.numberOfSessions = numberOfSessions; } /** * * @param numberOfSessions the total number of sessions in the tournament * @param now the current timestamp */ public TournamentStarted(Long numberOfSessions, Long now) { super(now); this.numberOfSessions = numberOfSessions; } public Long getNumberOfSessions() { return numberOfSessions; } @Override public String toString() { return "TournamentStarted[" + getTime() + "," + numberOfSessions + "]"; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((numberOfSessions == null) ? 0 : numberOfSessions.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; TournamentStarted other = (TournamentStarted) obj; if (numberOfSessions == null) { if (other.numberOfSessions != null) return false; } else if (!numberOfSessions.equals(other.numberOfSessions)) return false; return true; } }