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

org.apache.tinkerpop.gremlin.ogm.paths.steps.Step.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
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal

/**
 * A [Step] defines a single manipulation to the underlying GraphTraversal.
 */
interface Step : Path {

    override fun path() = listOf(this)

    open class ToSingle(
            private val step: (StepTraverser) -> GraphTraversal<*, TO>
    ) : Path.ToSingle, Step {
        override fun invoke(from: StepTraverser): GraphTraversal<*, TO> = step(from)
    }

    open class ToOptional(
            private val step: (StepTraverser) -> GraphTraversal<*, TO>
    ) : Path.ToOptional, Step {
        override fun invoke(from: StepTraverser): GraphTraversal<*, TO> = step(from)
    }

    open class ToMany(
            private val step: (StepTraverser) -> GraphTraversal<*, TO>
    ) : Path.ToMany, Step {
        override fun invoke(from: StepTraverser): GraphTraversal<*, TO> = step(from)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy