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

org.apache.tinkerpop.gremlin.ogm.mappers.VertexDeserializer.kt Maven / Gradle / Ivy

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