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

org.vertexium.cypher.functions.string.ToStringFunction Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
package org.vertexium.cypher.functions.string;

import org.vertexium.cypher.exceptions.VertexiumCypherTypeErrorException;
import org.vertexium.cypher.functions.TypeConversionFunction;

public class ToStringFunction extends TypeConversionFunction {
    @Override
    protected Object convert(Object value) {
        if (value == null) {
            return null;
        }
        if (value instanceof String) {
            return value;
        }
        if (value instanceof Number
            || value instanceof Boolean) {
            return value.toString();
        }
        throw new VertexiumCypherTypeErrorException("InvalidArgumentValue: " + value + " (" + value.getClass().getName() + ")");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy