org.vertexium.cypher.VertexiumCypherQueryResult Maven / Gradle / Ivy
package org.vertexium.cypher;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public class VertexiumCypherQueryResult {
private final String[] columnNames;
private List rows;
public VertexiumCypherQueryResult(String[] columnNames, List rows) {
this.columnNames = columnNames;
this.rows = rows;
}
public static VertexiumCypherQueryResult createEmpty() {
return new VertexiumCypherQueryResult(new String[0], ImmutableList.of());
}
public String[] getColumnNames() {
return columnNames;
}
public List getRows() {
return rows;
}
public VertexiumCypherQueryResult concat(VertexiumCypherQueryResult newResults, boolean all) {
List newRows = new ArrayList<>();
newRows.addAll(getRows());
if (all) {
newRows.addAll(newResults.getRows());
} else {
for (Row row : newResults.getRows()) {
if (!getRows().contains(row)) {
newRows.add(row);
}
}
}
return new VertexiumCypherQueryResult(columnNames, newRows);
}
public static class Row {
private final List