| Total Complexity | 5 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | /* |
||
| 27 | public final class ItemSold { |
||
| 28 | private final boolean success; |
||
| 29 | |||
| 30 | 1 | public ItemSold(boolean success) { |
|
| 31 | 1 | this.success = success; |
|
| 32 | 1 | } |
|
| 33 | |||
| 34 | @Override |
||
| 35 | public String toString() { |
||
| 36 | 1 | return "ES" + (success ? "K" : "E"); |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Item successfully sold |
||
| 41 | */ |
||
| 42 | public static ItemSold success() { |
||
| 43 | 1 | return new ItemSold(true); |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Fail to sell the item |
||
| 48 | */ |
||
| 49 | public static ItemSold failed() { |
||
| 50 | 1 | return new ItemSold(false); |
|
| 51 | } |
||
| 53 |