package geniusweb.inform; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; /** * Informs that the session is finished, and also contains the bid that was * agreed on. * */ public class Finished implements Inform { private final Agreements agreements; /** * The session finished (can be for any reason). * * @param agreements the {@link Agreements} that were finally agreed on. */ @JsonCreator public Finished(@JsonProperty("agreements") Agreements agreements) { if (agreements == null) throw new NullPointerException("Agreements can't be null"); this.agreements = agreements; } public Agreements getAgreements() { return agreements; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((agreements == null) ? 0 : agreements.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Finished other = (Finished) obj; if (agreements == null) { if (other.agreements != null) return false; } else if (!agreements.equals(other.agreements)) return false; return true; } @Override public String toString() { return "Finished[" + agreements + "]"; } }