Beispiel #1
0
  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();
    }
  }
Beispiel #2
0
 void decreaseQualityBy(int amount) {
   if (getQuality() > 0) {
     item.quality = item.quality - amount;
   }
 }
Beispiel #3
0
 void setQualityToZero() {
   item.quality = 0;
 }
Beispiel #4
0
 void increaseQualityBy(int amount) {
   if (isNotTopQuality()) {
     item.quality = item.quality + amount;
   }
 }
Beispiel #5
0
 private void decreaseQuality() {
   item.quality = item.quality - QUALITY_UNIT;
 }
Beispiel #6
0
 private void increaseQuality() {
   item.quality = item.quality + QUALITY_UNIT;
 }