mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-12 02:14:07 +00:00
Reformat rest of the design patterns - Issue #224
This commit is contained in:
1 parent
449340bd2b
commit
306b1f3d31
337 files changed
+6740
-6847
No files matched your search
@@ -7,14 +7,15 @@ package com.iluwatar.privateclassdata;
|
||||
*/
|
||||
public class ImmutableStew {
|
||||
|
||||
private StewData data;
|
||||
|
||||
public ImmutableStew(int numPotatoes, int numCarrots, int numMeat, int numPeppers) {
|
||||
data = new StewData(numPotatoes, numCarrots, numMeat, numPeppers);
|
||||
}
|
||||
|
||||
public void mix() {
|
||||
System.out.println(String.format("Mixing the immutable stew we find: %d potatoes, %d carrots, %d meat and %d peppers",
|
||||
data.getNumPotatoes(), data.getNumCarrots(), data.getNumMeat(), data.getNumPeppers()));
|
||||
}
|
||||
private StewData data;
|
||||
|
||||
public ImmutableStew(int numPotatoes, int numCarrots, int numMeat, int numPeppers) {
|
||||
data = new StewData(numPotatoes, numCarrots, numMeat, numPeppers);
|
||||
}
|
||||
|
||||
public void mix() {
|
||||
System.out.println(String.format(
|
||||
"Mixing the immutable stew we find: %d potatoes, %d carrots, %d meat and %d peppers",
|
||||
data.getNumPotatoes(), data.getNumCarrots(), data.getNumMeat(), data.getNumPeppers()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user