![JAR search and dependency download from the Maven repository](/logo.png)
com.ecyshor.cassmig.StatementBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cassandra-migration Show documentation
Show all versions of cassandra-migration Show documentation
Java schema migration library for Cassandra
package com.ecyshor.cassmig;
import com.ecyshor.cassmig.exception.InvalidDataException;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
public class StatementBuilder {
public static List buildStatementsFromLines(List statementLines) {
List statements = Lists.newArrayList();
String completeStatement = "";
for (String statementLine : statementLines) {
if (StringUtils.isNotBlank(statementLine)) {
completeStatement += statementLine;
if (completeStatement.contains(";")) {
statements.add(completeStatement);
completeStatement = "";
}
}
}
if (!completeStatement.isEmpty()) {
throw new InvalidDataException("The statement " + completeStatement + "is not valid as it does not end in ;");
}
return statements;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy