source: events/src/main/java/geniusweb/inform/Finished.java@ 22

Last change on this file since 22 was 21, checked in by bart, 4 years ago

Version 1.5.

File size: 1.3 KB
Line 
1package geniusweb.inform;
2
3import com.fasterxml.jackson.annotation.JsonCreator;
4import com.fasterxml.jackson.annotation.JsonProperty;
5
6/**
7 * Informs that the session is finished, and also contains the bid that was
8 * agreed on.
9 *
10 */
11public class Finished implements Inform {
12 private final Agreements agreements;
13
14 /**
15 * The session finished (can be for any reason).
16 *
17 * @param agreedBid the bid that was finally agreed on; null if no
18 * agreement.
19 */
20 @JsonCreator
21 public Finished(@JsonProperty("agreements") Agreements agreements) {
22 this.agreements = agreements;
23 }
24
25 public Agreements getAgreement() {
26 return agreements;
27 }
28
29 @Override
30 public int hashCode() {
31 final int prime = 31;
32 int result = 1;
33 result = prime * result
34 + ((agreements == null) ? 0 : agreements.hashCode());
35 return result;
36 }
37
38 @Override
39 public boolean equals(Object obj) {
40 if (this == obj)
41 return true;
42 if (obj == null)
43 return false;
44 if (getClass() != obj.getClass())
45 return false;
46 Finished other = (Finished) obj;
47 if (agreements == null) {
48 if (other.agreements != null)
49 return false;
50 } else if (!agreements.equals(other.agreements))
51 return false;
52 return true;
53 }
54
55 @Override
56 public String toString() {
57 return "Finished[" + agreements + "]";
58 }
59}
Note: See TracBrowser for help on using the repository browser.