mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 06:21:29 +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 class AgedBrie implements CustomisedItem {
|
||||||
|
|
||||||
public Item item;
|
private final Item item;
|
||||||
|
|
||||||
public AgedBrie(Item item) {
|
public AgedBrie(Item item) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.gildedrose.item;
|
|||||||
|
|
||||||
public class BackstagePassesItem implements CustomisedItem {
|
public class BackstagePassesItem implements CustomisedItem {
|
||||||
|
|
||||||
public Item item;
|
private final Item item;
|
||||||
|
|
||||||
public BackstagePassesItem(Item item) {
|
public BackstagePassesItem(Item item) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ public class CustomisedItemFactory {
|
|||||||
|
|
||||||
public CustomisedItem customiseItem(Item item) {
|
public CustomisedItem customiseItem(Item item) {
|
||||||
if (item.name.equals(SULFURAS)) {
|
if (item.name.equals(SULFURAS)) {
|
||||||
return new Sulfuras(item);
|
return new Sulfuras();
|
||||||
} else if (item.name.equals(BRIE)) {
|
} else if (item.name.equals(BRIE)) {
|
||||||
return new AgedBrie(item);
|
return new AgedBrie(item);
|
||||||
} else if (item.name.equals(BACKSTAGE_PASSES_ITEM)) {
|
} else if (item.name.equals(BACKSTAGE_PASSES_ITEM)) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.gildedrose.item;
|
|||||||
|
|
||||||
public class StandardItem implements CustomisedItem {
|
public class StandardItem implements CustomisedItem {
|
||||||
|
|
||||||
public Item item;
|
private final Item item;
|
||||||
|
|
||||||
public StandardItem(Item item) {
|
public StandardItem(Item item) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
|||||||
@ -2,11 +2,6 @@ package com.gildedrose.item;
|
|||||||
|
|
||||||
public class Sulfuras implements CustomisedItem {
|
public class Sulfuras implements CustomisedItem {
|
||||||
|
|
||||||
public Item item;
|
|
||||||
|
|
||||||
public Sulfuras(Item item) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateState() {
|
public void updateState() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user