diff --git a/Java/src/main/java/com/gildedrose/GildedRose.java b/Java/src/main/java/com/gildedrose/GildedRose.java index 6d2efca2..d6ac7aa6 100644 --- a/Java/src/main/java/com/gildedrose/GildedRose.java +++ b/Java/src/main/java/com/gildedrose/GildedRose.java @@ -1,6 +1,10 @@ package com.gildedrose; -class GildedRose { +class GildedRose { + + public static final String AGED_BRIE = "Aged Brie"; + public static final String SULFURAS = "Sulfuras, Hand of Ragnaros"; + public static final String BACKSTAGE = "Backstage passes to a TAFKAL80ETC concert"; private Item[] items; @@ -15,10 +19,10 @@ class GildedRose { } private void updateItemQuality(Item item) { - if (!item.name.equals("Aged Brie") - && !item.name.equals("Backstage passes to a TAFKAL80ETC concert")) { + if (!item.name.equals(AGED_BRIE) + && !item.name.equals(BACKSTAGE)) { if (item.quality > 0) { - if (!item.name.equals("Sulfuras, Hand of Ragnaros")) { + if (!item.name.equals(SULFURAS)) { item.quality = item.quality - 1; } } @@ -26,7 +30,7 @@ class GildedRose { if (item.quality < 50) { item.quality = item.quality + 1; - if (item.name.equals("Backstage passes to a TAFKAL80ETC concert")) { + if (item.name.equals(BACKSTAGE)) { if (item.sellIn < 11) { if (item.quality < 50) { item.quality = item.quality + 1; @@ -42,15 +46,15 @@ class GildedRose { } } - if (!item.name.equals("Sulfuras, Hand of Ragnaros")) { + if (!item.name.equals(SULFURAS)) { item.sellIn = item.sellIn - 1; } if (item.sellIn < 0) { - if (!item.name.equals("Aged Brie")) { - if (!item.name.equals("Backstage passes to a TAFKAL80ETC concert")) { + if (!item.name.equals(AGED_BRIE)) { + if (!item.name.equals(BACKSTAGE)) { if (item.quality > 0) { - if (!item.name.equals("Sulfuras, Hand of Ragnaros")) { + if (!item.name.equals(SULFURAS)) { item.quality = item.quality - 1; } }