Line | |
---|
1 | package bargainingchips.protocol;
|
---|
2 |
|
---|
3 | import bargainingchips.actions.Offer;
|
---|
4 | import bargainingchips.outcomes.Outcome;
|
---|
5 |
|
---|
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 | */
|
---|
15 | public class ValidationResult
|
---|
16 | {
|
---|
17 | private final boolean valid;
|
---|
18 | private final Outcome outcome;
|
---|
19 |
|
---|
20 | public ValidationResult()
|
---|
21 | {
|
---|
22 | valid = false;
|
---|
23 | outcome = null;
|
---|
24 | }
|
---|
25 |
|
---|
26 | public ValidationResult(boolean valid, Outcome outcome)
|
---|
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 | {
|
---|
39 | return outcome != null;
|
---|
40 | }
|
---|
41 |
|
---|
42 | public Offer getOutcome()
|
---|
43 | {
|
---|
44 | return outcome;
|
---|
45 | }
|
---|
46 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.