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

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

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

import org.vertexium.cypher.exceptions.VertexiumCypherArgumentErrorException;

import java.util.Arrays;
import java.util.stream.Collectors;

public class FunctionUtils {
    public static void assertArgumentCount(Object[] arguments, int... expectedCounts) {
        for (int count : expectedCounts) {
            if (arguments.length == count) {
                return;
            }
        }

        throw new VertexiumCypherArgumentErrorException(String.format(
            "Unexpected number of arguments. Expected %s, found %d",
            Arrays.stream(expectedCounts).mapToObj(Integer::toString).collect(Collectors.joining(", ")),
            arguments.length
        ));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy