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

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

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

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class CypherRelationshipsPattern extends CypherAstBase {
    private final CypherNodePattern nodePattern;
    private final List patternElementChains;

    public CypherRelationshipsPattern(CypherNodePattern nodePattern, List patternElementChains) {
        this.nodePattern = nodePattern;
        this.patternElementChains = patternElementChains;
    }

    public CypherNodePattern getNodePattern() {
        return nodePattern;
    }

    public List getPatternElementChains() {
        return patternElementChains;
    }

    @Override
    public String toString() {
        return String.format(
            "%s%s",
            getNodePattern(),
            getPatternElementChains().stream().map(CypherElementPattern::toString).collect(Collectors.joining(""))
        );
    }

    @Override
    public Stream getChildren() {
        return Stream.concat(
            Stream.of(nodePattern),
            patternElementChains.stream()
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy