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

org.vertexium.cypher.ast.model.CypherMergeClause 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.Stream;

public class CypherMergeClause extends CypherClause {
    private final CypherPatternPart patternPart;
    private final List mergeActions;

    public CypherMergeClause(CypherPatternPart patternPart, List mergeActions) {
        this.patternPart = patternPart;
        this.mergeActions = mergeActions;
    }

    public CypherPatternPart getPatternPart() {
        return patternPart;
    }

    public List getMergeActions() {
        return mergeActions;
    }

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

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder();
        result.append("MERGE ");
        result.append(getPatternPart());
        for (CypherMergeAction mergeAction : getMergeActions()) {
            result.append(" ");
            result.append(mergeAction.toString());
        }
        return result.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy