Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Factory Quality Control | Intermediate Operations in Stream API
Stream API
course content

Conteúdo do Curso

Stream API

Stream API

1. Fundamentals and Functional Capabilities of Stream API
4. Practical Applications of Stream API

book
Challenge: Factory Quality Control

Tarefa

Swipe to start coding

A factory receives multiple batches of parts, but some parts are defective and must be removed to identify high-quality components, which should be displayed without duplicates.

The PartBatch class represents a batch of parts, with a batch name (batchName) and a list of parts (parts). To access the list of parts from a batch, you use the getParts() method, and to retrieve the batch name, you use the getBatchName() method.

  1. Extract all parts from each batch using flatMap() method.
  2. Filter out defective parts by checking if the part name starts with Defective using filter() method.
  3. Remove duplicate parts to get a list of unique quality parts using distinct() method.

Solução

java

solution

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 8
toggle bottom row

book
Challenge: Factory Quality Control

Tarefa

Swipe to start coding

A factory receives multiple batches of parts, but some parts are defective and must be removed to identify high-quality components, which should be displayed without duplicates.

The PartBatch class represents a batch of parts, with a batch name (batchName) and a list of parts (parts). To access the list of parts from a batch, you use the getParts() method, and to retrieve the batch name, you use the getBatchName() method.

  1. Extract all parts from each batch using flatMap() method.
  2. Filter out defective parts by checking if the part name starts with Defective using filter() method.
  3. Remove duplicate parts to get a list of unique quality parts using distinct() method.

Solução

java

solution

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 8
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt