org.apache.tinkerpop.gremlin.ogm.mappers.VertexDeserializer.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.mappers
import org.apache.tinkerpop.gremlin.ogm.elements.Vertex
import org.apache.tinkerpop.gremlin.ogm.extensions.getProperties
import org.apache.tinkerpop.gremlin.ogm.mappers.EdgeDeserializer.Companion.idTag
import org.apache.tinkerpop.gremlin.ogm.reflection.GraphDescription
internal class VertexDeserializer(
private val graphDescription: GraphDescription
) {
operator fun invoke(from: org.apache.tinkerpop.gremlin.structure.Vertex): T {
val vertexDescription = graphDescription.getVertexDescription(from.label())
val objectDeserializer = ObjectDeserializer(graphDescription, vertexDescription, Pair(idTag, vertexDescription.id))
return objectDeserializer(from.getProperties() + Pair(idTag, from.id()))
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy