From 0767c48220adb5314ebf6b945d07249a513147aa Mon Sep 17 00:00:00 2001 From: Kyle Clemens Date: Thu, 1 Oct 2015 17:15:41 -0400 Subject: [PATCH] Added: #getCondiments() --- src/main/java/org/drtshock/Potato.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/drtshock/Potato.java b/src/main/java/org/drtshock/Potato.java index 4110420..d74b016 100644 --- a/src/main/java/org/drtshock/Potato.java +++ b/src/main/java/org/drtshock/Potato.java @@ -23,6 +23,15 @@ public class Potato implements Tuber { } } + /** + * Gets the condiments on this potato. + * + * @return Mutable list of condiments + */ + public List getCondiments() { + return this.condiments; + } + /** * Prepares the potato for consumption. Adds various condiments and prints them to stdout. Ensures that the potato * is delicious. If it is not, a {@link NotDeliciousException} is thrown. @@ -42,15 +51,17 @@ public class Potato implements Tuber { */ public void addCondiments(String... names) { for (String condimentName : names) { - this.condiments.add(new Condiment(condimentName)); + this.getCondiments().add(new Condiment(condimentName)); } } /** * Prints the names of the condiments on this potato to stdout. + * + * @see #getCondiments() */ public void listCondiments() { - for (Condiment condiment : this.condiments) { + for (Condiment condiment : this.getCondiments()) { System.out.println(condiment.getName()); } }