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

Contenido del Curso

Stream API

Stream API

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

book
Challenge: Factory Quality Control

Tarea

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.

Solución

java

solution

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 8
toggle bottom row

book
Challenge: Factory Quality Control

Tarea

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.

Solución

java

solution

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 8
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt