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

org.vertexium.cypher.functions.SimpleCypherFunction Maven / Gradle / Ivy

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

import org.vertexium.cypher.VertexiumCypherQueryContext;
import org.vertexium.cypher.exceptions.VertexiumCypherNotImplemented;
import org.vertexium.cypher.executionPlan.ExecutionStepWithResultName;
import org.vertexium.cypher.executionPlan.FunctionInvocationExecutionStep;

public abstract class SimpleCypherFunction implements CypherFunction {
    @Override
    public ExecutionStepWithResultName create(String resultName, boolean distinct, ExecutionStepWithResultName[] argumentsExecutionStep) {
        if (distinct) {
            throw new VertexiumCypherNotImplemented("distinct");
        }
        return new FunctionInvocationExecutionStep(getClass().getSimpleName(), resultName, argumentsExecutionStep) {
            @Override
            protected Object executeFunction(VertexiumCypherQueryContext ctx, Object[] arguments) {
                return SimpleCypherFunction.this.executeFunction(ctx, arguments);
            }
        };
    }

    protected abstract Object executeFunction(VertexiumCypherQueryContext ctx, Object[] arguments);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy