private void applyDecreaseQualityPolicies() { final boolean minQualityNotReached = item.quality > MIN_QUALITY; if (minQualityNotReached) { if (isBrie()) return; if (isBackstage()) { if (item.sellIn <= SELL_BY_DATE_LIMIT) { item.quality = 0; } return; } if (item.sellIn <= SELL_BY_DATE_LIMIT) { decreaseQuality(); } decreaseQuality(); } }
void decreaseQualityBy(int amount) { if (getQuality() > 0) { item.quality = item.quality - amount; } }
void setQualityToZero() { item.quality = 0; }
void increaseQualityBy(int amount) { if (isNotTopQuality()) { item.quality = item.quality + amount; } }
private void decreaseQuality() { item.quality = item.quality - QUALITY_UNIT; }
private void increaseQuality() { item.quality = item.quality + QUALITY_UNIT; }