mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-14 22:21:20 +00:00
makes fields private
This commit is contained in:
parent
ad087914bc
commit
8b1df0a5e6
@ -2,7 +2,7 @@ package com.gildedrose.item;
|
||||
|
||||
public class AgedBrie implements CustomisedItem {
|
||||
|
||||
public Item item;
|
||||
private final Item item;
|
||||
|
||||
public AgedBrie(Item item) {
|
||||
this.item = item;
|
||||
|
||||
@ -2,7 +2,7 @@ package com.gildedrose.item;
|
||||
|
||||
public class BackstagePassesItem implements CustomisedItem {
|
||||
|
||||
public Item item;
|
||||
private final Item item;
|
||||
|
||||
public BackstagePassesItem(Item item) {
|
||||
this.item = item;
|
||||
|
||||
@ -9,7 +9,7 @@ public class CustomisedItemFactory {
|
||||
|
||||
public CustomisedItem customiseItem(Item item) {
|
||||
if (item.name.equals(SULFURAS)) {
|
||||
return new Sulfuras(item);
|
||||
return new Sulfuras();
|
||||
} else if (item.name.equals(BRIE)) {
|
||||
return new AgedBrie(item);
|
||||
} else if (item.name.equals(BACKSTAGE_PASSES_ITEM)) {
|
||||
|
||||
@ -2,7 +2,7 @@ package com.gildedrose.item;
|
||||
|
||||
public class StandardItem implements CustomisedItem {
|
||||
|
||||
public Item item;
|
||||
private final Item item;
|
||||
|
||||
public StandardItem(Item item) {
|
||||
this.item = item;
|
||||
|
||||
@ -2,11 +2,6 @@ package com.gildedrose.item;
|
||||
|
||||
public class Sulfuras implements CustomisedItem {
|
||||
|
||||
public Item item;
|
||||
|
||||
public Sulfuras(Item item) {
|
||||
}
|
||||
|
||||
public void updateState() {
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user