Ignore:
Timestamp:
09/22/20 08:52:04 (4 years ago)
Author:
bart
Message:

Version 1.5.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocol/src/main/java/geniusweb/protocol/session/SessionResult.java

    r20 r21  
    1010import com.fasterxml.jackson.annotation.JsonTypeInfo;
    1111
    12 import geniusweb.issuevalue.Bid;
     12import geniusweb.inform.Agreements;
    1313import geniusweb.references.PartyWithProfile;
    1414
     
    2020public class SessionResult {
    2121        private final List<PartyWithProfile> participants;
    22         private final Bid agreement;
     22        private final Agreements agreements;
    2323        private final List<Double> penalties;
    2424
     
    3333         *                     never be null. Some of them may have entered later of
    3434         *                     left early. This list should contain them all.
    35          * @param agreement    the final agreement {@link Bid} of the session. Null
    36          *                     if no agreement was reached.
     35         * @param agreements   the final Agreements.
    3736         * @param penalties    the penalties in [0,1] for each participant, same
    3837         *                     order as the participants list.
     
    4847        public SessionResult(
    4948                        @JsonProperty("participants") List<PartyWithProfile> participants,
    50                         @JsonProperty("agreement") Bid agreement,
     49                        @JsonProperty("agreements") Agreements agreements,
    5150                        @JsonProperty("penalties") List<Double> penalties,
    5251                        @JsonProperty("error") Throwable error) {
    5352                this.participants = participants;
    54                 this.agreement = agreement;
     53                this.agreements = agreements;
    5554                this.penalties = penalties;
    5655                this.error = error;
     
    6968
    7069        /**
    71          * 8return the final agreement {@link Bid} of the session. Null if no
    72          * agreement was reached.
     70         * 8return the final {@link Agreements} of the session. May be empty, not
     71         * null
    7372         */
    74         public Bid getAgreement() {
    75                 return agreement;
     73        public Agreements getAgreements() {
     74                return agreements;
    7675        };
    7776
     
    9998        @Override
    10099        public String toString() {
    101                 return "SessionResult[" + participants + "," + agreement + ","
     100                return "SessionResult[" + participants + "," + agreements + ","
    102101                                + penalties + "," + error + "]";
    103102        }
     
    108107                int result = 1;
    109108                result = prime * result
    110                                 + ((agreement == null) ? 0 : agreement.hashCode());
     109                                + ((agreements == null) ? 0 : agreements.hashCode());
    111110                result = prime * result + ((error == null) ? 0 : error.hashCode());
    112111                result = prime * result
     
    126125                        return false;
    127126                SessionResult other = (SessionResult) obj;
    128                 if (agreement == null) {
    129                         if (other.agreement != null)
     127                if (agreements == null) {
     128                        if (other.agreements != null)
    130129                                return false;
    131                 } else if (!agreement.equals(other.agreement))
     130                } else if (!agreements.equals(other.agreements))
    132131                        return false;
    133132                if (error == null) {
Note: See TracChangeset for help on using the changeset viewer.