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

org.modelfabric.sparql.mapper.DelegatingSolutionMapper.scala Maven / Gradle / Ivy

There is a newer version: 0.2.13
Show newest version
package org.modelfabric.sparql.mapper

import org.modelfabric.sparql.api.QuerySolution


/**
 * A helper mapper that delegates mapping to a specified function.
 */
class DelegatingSolutionMapper[T] private (mapper : QuerySolution ⇒ T)
    extends SolutionMapper[T] {

  def map(querySolution : QuerySolution) : T = {
    mapper(querySolution)
  }
}

object DelegatingSolutionMapper {
  def apply[T](mapper : QuerySolution ⇒ T) = new DelegatingSolutionMapper[T](mapper)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy