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

org.vertexium.cypher.ast.model.CypherFunctionInvocation Maven / Gradle / Ivy

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

import java.util.stream.Stream;

public class CypherFunctionInvocation extends CypherAstBase {
    private final String functionName;
    private final boolean distinct;
    private final CypherAstBase[] arguments;

    public CypherFunctionInvocation(String functionName, boolean distinct, CypherAstBase... arguments) {
        this.functionName = functionName;
        this.distinct = distinct;
        this.arguments = arguments;
    }

    public String getFunctionName() {
        return functionName;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public CypherAstBase[] getArguments() {
        return arguments;
    }

    @Override
    public String toString() {
        return String.format(
            "%s(%s%s)",
            getFunctionName(),
            isDistinct() ? "DISTINCT " : "",
            CypherExpression.toString(getArguments())
        );
    }

    @Override
    public Stream getChildren() {
        return Stream.of(arguments);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy