org.apache.tinkerpop.gremlin.ogm.paths.steps.Map.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-gremlin-ogm Show documentation
Show all versions of kotlin-gremlin-ogm Show documentation
The Object Graph Mapping Library for Kotlin and Gremlin
package org.apache.tinkerpop.gremlin.ogm.paths.steps
import org.apache.tinkerpop.gremlin.ogm.paths.Path
/**
* A step that maps the current object to zero or more new objects.
*/
class Map(private val map: (FROM) -> TO) : Step.ToSingle({
it.traversal.map { map(it.get()) }
})
fun Path.ToMany.map(map: (TO) -> NEXT): Path.ToMany = to(Map(map))
fun Path.ToOptional.map(map: (TO) -> NEXT): Path.ToOptional = to(Map(map))
fun Path.ToSingle.map(map: (TO) -> NEXT): Path.ToSingle = to(Map(map))
© 2015 - 2024 Weber Informatics LLC | Privacy Policy