diff options
| author | Kyle Clemens <jkc.clemens@gmail.com> | 2015-10-01 17:15:41 -0400 |
|---|---|---|
| committer | Kyle Clemens <jkc.clemens@gmail.com> | 2015-10-01 17:15:41 -0400 |
| commit | 0767c48220adb5314ebf6b945d07249a513147aa (patch) | |
| tree | 951ebec14eb1de5659784a942059215485d04a51 /src | |
| parent | 306ddeaab560c3304559bc41a3fa39e04bf83535 (diff) | |
Added: #getCondiments()
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/org/drtshock/Potato.java | 15 |
1 files 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 @@ -24,6 +24,15 @@ public class Potato implements Tuber { } /** + * Gets the condiments on this potato. + * + * @return Mutable list of condiments + */ + public List<Condiment> 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()); } } |
