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

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

More consistent ValidationResult

File size: 807 bytes
Line 
1package bargainingchips.protocol;
2
3import bargainingchips.actions.Offer;
4
5/**
6 * An offer may be valid or invalid.
7 * As a secondary result, the may also lead to an outcome with offer type END, namely:
8 *
9 * 1. An agreement
10 * 2. A disagreement
11 *
12 * Otherwise, the negotiation is ongoing and the outcome is null.
13 */
14public class ValidationResult
15{
16 boolean valid;
17 Offer outcome;
18
19 public ValidationResult()
20 {
21 valid = false;
22 outcome = null;
23 }
24
25 public ValidationResult(boolean valid, Offer outcome)
26 {
27 super();
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 {
39 return outcome != null && outcome.isEnd();
40 }
41
42 public Offer getOutcome()
43 {
44 return outcome;
45 }
46}
Note: See TracBrowser for help on using the repository browser.