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

pl.touk.nussknacker.engine.compile.FragmentSourceWithTestWithParametersSupportFactory.scala Maven / Gradle / Ivy

The newest version!
package pl.touk.nussknacker.engine.compile

import pl.touk.nussknacker.engine.api.definition.Parameter
import pl.touk.nussknacker.engine.api.parameter.ParameterName
import pl.touk.nussknacker.engine.api.process.{Source, TestWithParametersSupport}

class FragmentSourceWithTestWithParametersSupportFactory(
    parameterDefinitions: List[Parameter]
) {

  def createSource(): Source with TestWithParametersSupport[Any] = {
    new Source with TestWithParametersSupport[Any] {
      override def testParametersDefinition: List[Parameter] = parameterDefinitions

      override def parametersToTestData(params: Map[ParameterName, AnyRef]): Any =
        params.map { case (name, value) => (name.value, value) }
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy