Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LiudmylaPechevysta
Copy link

No description provided.

Copy link

@Ivan95kos Ivan95kos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job overall!

Comment on lines +9 to +10


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines

Suggested change

}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line

Suggested change

StringBuilder report = new StringBuilder("fruit,quantity").append(System.lineSeparator());
for (Map.Entry<String, Integer> entry : FruitStorage.fruitQuantities.entrySet()) {
report.append(entry.getKey())
.append(",")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.append(",")
.append(SEPARATOR)

public class ReportServiceImpl implements ReportService {
@Override
public String report() {
StringBuilder report = new StringBuilder("fruit,quantity").append(System.lineSeparator());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StringBuilder report = new StringBuilder("fruit,quantity").append(System.lineSeparator());
StringBuilder report = new StringBuilder(HEADER).append(System.lineSeparator());

FruitStorage.fruitQuantities.put(transaction.getFruit(), transaction.getQuantity());
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

public interface OperationStrategy {
OperationHandler get(FruitTransaction.Operation operation);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

.put(transaction.getFruit(), oldQuantity + transaction.getQuantity());
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -0,0 +1,18 @@
package core.basesyntax.strategy;

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

Suggested change
package core.basesyntax.strategy;
package core.basesyntax.strategy.impl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants