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

org.apache.tinkerpop.gremlin.ogm.paths.steps.Map.kt Maven / Gradle / Ivy

There is a newer version: 0.21.0
Show newest version
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