当前位置: 首页>>代码示例>>Java>>正文


Java MutableList.reject方法代码示例

本文整理汇总了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"));
    }
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:19,代码来源:BaselineValidatorMain.java

示例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;
        }
    });
}
 
开发者ID:goldmansachs,项目名称:tablasco,代码行数:21,代码来源:IndexMapTableVerifier.java

示例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();
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:33,代码来源:BaselineTableChangeParser.java

示例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;
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:62,代码来源:AbstractDdlReveng.java


注:本文中的org.eclipse.collections.api.list.MutableList.reject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。