You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ola Camila tudo bem?
Eu não entendi direto esse método, principalemte no for (Map.Entry<Long, Produto> entry : estoqueProdutosMap.entrySet()) .
Poderia me ajudar por gentileza.
Ola Camila tudo bem?
Eu não entendi direto esse método, principalemte no for (Map.Entry<Long, Produto> entry : estoqueProdutosMap.entrySet()) .
Poderia me ajudar por gentileza.
public Produto obterProdutoMaiorQuantidadeValorTotalNoEstoque() {
Produto produtoMaiorQuantidadeValorNoEstoque = null;
double maiorValorTotalProdutoEstoque = 0d;
if (!estoqueProdutosMap.isEmpty()) {
for (Map.Entry<Long, Produto> entry : estoqueProdutosMap.entrySet()) {
double valorProdutoEmEstoque = entry.getValue().getPreco() * entry.getValue().getQuantidade();
if (valorProdutoEmEstoque > maiorValorTotalProdutoEstoque) {
maiorValorTotalProdutoEstoque = valorProdutoEmEstoque;
produtoMaiorQuantidadeValorNoEstoque = entry.getValue();
}
}
}
return produtoMaiorQuantidadeValorNoEstoque;
}
The text was updated successfully, but these errors were encountered: