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

grails.plugin.json.view.api.jsonapi.DefaultJsonApiIdRenderer.groovy Maven / Gradle / Ivy

There is a newer version: 6.1.0
Show newest version
package grails.plugin.json.view.api.jsonapi

import groovy.transform.CompileStatic
import org.grails.datastore.mapping.model.PersistentProperty

@CompileStatic
class DefaultJsonApiIdRenderer implements JsonApiIdRenderStrategy {

    @Override
    Object render(Object object, PersistentProperty property) {
        final String propertyName = property.name
        if (object && object.hasProperty(propertyName)) {
            return object.getAt(propertyName).toString()
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy