source: src/main/java/bargainingchips/protocol/ValidationResult.java@ 337

Last change on this file since 337 was 327, checked in by Tim Baarslag, 5 years ago

Outcome defined

File size: 850 bytes
RevLine 
[319]1package bargainingchips.protocol;
2
3import bargainingchips.actions.Offer;
[327]4import bargainingchips.outcomes.Outcome;
[319]5
[326]6/**
7 * An offer may be valid or invalid.
8 * As a secondary result, the may also lead to an outcome with offer type END, namely:
9 *
10 * 1. An agreement
11 * 2. A disagreement
12 *
13 * Otherwise, the negotiation is ongoing and the outcome is null.
14 */
[319]15public class ValidationResult
16{
[327]17 private final boolean valid;
18 private final Outcome outcome;
[319]19
20 public ValidationResult()
21 {
22 valid = false;
23 outcome = null;
24 }
25
[327]26 public ValidationResult(boolean valid, Outcome outcome)
[319]27 {
28 this.valid = valid;
29 this.outcome = outcome;
30 }
31
32 public boolean isValid()
33 {
34 return valid;
35 }
36
37 public boolean hasEnded()
38 {
[327]39 return outcome != null;
[319]40 }
41
42 public Offer getOutcome()
43 {
44 return outcome;
45 }
46}
Note: See TracBrowser for help on using the repository browser.