All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scaladebugger.api.pipelines.ForeachOperation.scala Maven / Gradle / Ivy

package org.scaladebugger.api.pipelines

/**
 * Represents an operation that maps data to other values in a pipeline.
 *
 * @param foreachFunc The function to apply
 * @tparam A The type of data coming into the operation
 */
class ForeachOperation[A](
  private val foreachFunc: (A) => Unit
) extends Operation[A, Unit] {
  /**
   * Processes incoming data.
   *
   * @param data The data to process
   *
   * @return Unused (empty collection)
   */
  override def process(data: Seq[A]): Seq[Unit] = {
    data.foreach(foreachFunc)
    Nil
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy