本文整理汇总了Java中org.eclipse.collections.api.list.MutableList.reject方法的典型用法代码示例。如果您正苦于以下问题:Java MutableList.reject方法的具体用法?Java MutableList.reject怎么用?Java MutableList.reject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.collections.api.list.MutableList
的用法示例。
在下文中一共展示了MutableList.reject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateNoBaselineBreaks
import org.eclipse.collections.api.list.MutableList; //导入方法依赖的package包/类
public void validateNoBaselineBreaks(DbDeployerAppContext appContext, Predicate<? super CompareBreak> breakIgnorePredicate) {
MutableList<CompareBreak> sortedCompareBreaks = this.calculateBaselineBreaks(appContext).toList().sortThis(
Comparators.fromFunctions(
CompareBreak.TO_COMPARE_SUBJECT,
Functions.chain(CompareBreak.TO_CLAZZ, CLASS_TO_NAME),
Functions.chain(Functions.getToClass(), CLASS_TO_NAME)
));
MutableList<CompareBreak> relevantBreaks = sortedCompareBreaks.reject(breakIgnorePredicate);
LOG.info("Found " + relevantBreaks.size() + " breaks");
if (!relevantBreaks.isEmpty()) {
throw new IllegalArgumentException(
"Found some mismatches between your change alters (LEFT) and your baseline files (RIGHT). Please review:\n"
+ relevantBreaks.makeString("\n"));
}
}
示例2: getColumnIndices
import org.eclipse.collections.api.list.MutableList; //导入方法依赖的package包/类
private MutableList<IndexMap> getColumnIndices(VerifiableTable actualData, VerifiableTable expectedData, CellComparator comparator)
{
List<String> expectedHeadings = getHeadings(expectedData, comparator);
List<String> actualHeadings = getHeadings(actualData, comparator);
IndexMapGenerator<String> columnGenerator = new IndexMapGenerator<>(expectedHeadings.iterator(), actualHeadings.iterator(), 0);
columnGenerator.generate();
MutableList<IndexMap> all = columnGenerator.getAll();
return all.reject(new Predicate<IndexMap>()
{
@Override
public boolean accept(IndexMap indexMap)
{
if (indexMap.isMissing())
{
return ignoreMissingColumns;
}
return indexMap.isSurplus() && ignoreSurplusColumns;
}
});
}
示例3: value
import org.eclipse.collections.api.list.MutableList; //导入方法依赖的package包/类
@Override
public ImmutableList<Change> value(final ChangeType defaultChangeType, final FileObject file, String fileContent, final String objectName, final String schema, TextMarkupDocumentSection packageMetadata) {
MutableList<String> sqls = MultiLineStringSplitter.createSplitterOnSpaceAndLine("GO").valueOf(fileContent);
sqls = sqls.reject(Predicates.attributePredicate(StringFunctions.trim(), StringPredicates.empty()));
MutableList<String> sortedSqls = this.sortSqls(sqls);
MutableList<Change> changes = sortedSqls.zipWithIndex().collect(
new Function<Pair<String, Integer>, Change>() {
@Override
public Change valueOf(Pair<String, Integer> object) {
String content = object.getOne();
int index = object.getTwo();
ChangeType changeType = getChangeType(content, defaultChangeType);
String changeName = "baseline-change-" + index;
boolean active = true;
String rollbackIfAlreadyDeployedCommand = null;
String rollbackContent = null;
ChangeIncremental change = new ChangeIncremental(changeType, schema, objectName,
changeName, index, BaselineTableChangeParser.this.contentHashStrategy.hashContent(content), content,
rollbackIfAlreadyDeployedCommand, active);
change.setRollbackContent(rollbackContent);
change.setFileLocation(file);
return change;
}
});
return changes.toImmutable();
}
示例4: getSqlSnippets
import org.eclipse.collections.api.list.MutableList; //导入方法依赖的package包/类
private MutableList<String> getSqlSnippets(File file) {
final MutableList<String> dataLines;
dataLines = FileUtilsCobra.readLines(file);
dataLines.forEachWithIndex(new ObjectIntProcedure<String>() {
@Override
public void value(String line, int i) {
if (!line.isEmpty() && line.charAt(0) == '\uFEFF') {
dataLines.set(i, dataLines.get(i).substring(1));
}
if (line.startsWith("--------------------")
&& dataLines.get(i + 1).startsWith("-- DDL Statements")
&& dataLines.get(i + 2).startsWith("--------------------")) {
dataLines.set(i, "");
dataLines.set(i + 1, "");
dataLines.set(i + 2, "");
} else if (line.startsWith("--------------------")
&& dataLines.get(i + 2).startsWith("-- DDL Statements")
&& dataLines.get(i + 4).startsWith("--------------------")) {
dataLines.set(i, "");
dataLines.set(i + 1, "");
dataLines.set(i + 2, "");
dataLines.set(i + 3, "");
dataLines.set(i + 4, "");
} else if (line.startsWith("-- DDL Statements for ")) {
dataLines.set(i, "");
}
// For PostgreSQL
if ((line.equals("--")
&& dataLines.get(i + 1).startsWith("-- Name: ")
&& dataLines.get(i + 2).equals("--"))) {
dataLines.set(i, "");
dataLines.set(i + 1, "GO");
dataLines.set(i + 2, "");
}
}
});
MutableList<String> sqlSnippets;
if (stringSplitter != null) {
String data = dataLines
.reject(skipLinePredicates != null ? Predicates.or(skipLinePredicates) : (Predicate) Predicates.alwaysFalse())
.makeString(SystemUtils.LINE_SEPARATOR);
sqlSnippets = stringSplitter.valueOf(data);
} else {
// If null, then default each line to being its own parsable statement
sqlSnippets = dataLines
.reject(skipLinePredicates != null ? Predicates.or(skipLinePredicates) : (Predicate) Predicates.alwaysFalse());
}
sqlSnippets = sqlSnippets.collect(new Function<String, String>() {
@Override
public String valueOf(String sqlSnippet) {
return StringUtils.stripStart(sqlSnippet, "\r\n \t");
}
});
sqlSnippets = sqlSnippets.select(StringPredicates.notBlank().and(Predicates.noneOf(skipPredicates)));
return sqlSnippets;
}