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

org.apache.tinkerpop.gremlin.ogm.mappers.ObjectSerializer.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.reflection.GraphDescription
import org.apache.tinkerpop.gremlin.ogm.reflection.ObjectDescription

internal class ObjectSerializer(
        private val graphDescription: GraphDescription,
        private val objectDescription: ObjectDescription
) : Mapper> {

    override fun invoke(from: T): Map =
            objectDescription.properties.mapValues {
                val propertyDescription = it.value
                val unserializedPropertyValue = propertyDescription.property.get(from)
                val serializer = PropertySerializer(graphDescription, propertyDescription)
                serializer(unserializedPropertyValue)
            }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy