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

org.apache.tinkerpop.gremlin.ogm.paths.steps.FlatMap.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 FlatMap(private val map: (FROM) -> Iterable) : Step.ToMany({
    it.traversal.flatMap { map(it.get()).iterator() }
})

fun  Path.ToMany.flatMap(map: (TO) -> Iterable): Path.ToMany = to(FlatMap(map))
fun  Path.ToOptional.flatMap(map: (TO) -> Iterable): Path.ToMany = to(FlatMap(map))
fun  Path.ToSingle.flatMap(map: (TO) -> Iterable): Path.ToMany = to(FlatMap(map))





© 2015 - 2024 Weber Informatics LLC | Privacy Policy