org.apache.tinkerpop.gremlin.ogm.traversals.GraphTraversalToOptional.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.traversals
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal
class GraphTraversalToOptional internal constructor(val traversal: GraphTraversal) {
fun fetch(): TO? = traversal.tryNext().orElse(null)
fun toSingle() = GraphTraversalToSingle(traversal)
fun toMany() = GraphTraversalToMany(traversal)
}
fun GraphTraversal.toOptional() = GraphTraversalToOptional(this)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy