Rev | Line | |
---|
[319] | 1 | package bargainingchips.protocol;
|
---|
| 2 |
|
---|
| 3 | import bargainingchips.actions.Offer;
|
---|
[327] | 4 | import 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] | 15 | public 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.