-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
used service, strategy packages #960
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job overall!
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lines
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line
StringBuilder report = new StringBuilder("fruit,quantity").append(System.lineSeparator()); | ||
for (Map.Entry<String, Integer> entry : FruitStorage.fruitQuantities.entrySet()) { | ||
report.append(entry.getKey()) | ||
.append(",") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.append(",") | |
.append(SEPARATOR) |
public class ReportServiceImpl implements ReportService { | ||
@Override | ||
public String report() { | ||
StringBuilder report = new StringBuilder("fruit,quantity").append(System.lineSeparator()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringBuilder report = new StringBuilder("fruit,quantity").append(System.lineSeparator()); | |
StringBuilder report = new StringBuilder(HEADER).append(System.lineSeparator()); |
FruitStorage.fruitQuantities.put(transaction.getFruit(), transaction.getQuantity()); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public interface OperationStrategy { | ||
OperationHandler get(FruitTransaction.Operation operation); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.put(transaction.getFruit(), oldQuantity + transaction.getQuantity()); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,18 @@ | |||
package core.basesyntax.strategy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the entire implementation from the strategy
package to the impl
package
package core.basesyntax.strategy; | |
package core.basesyntax.strategy.impl; |
No description provided.