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


Java MutableList.notEmpty方法代码示例

本文整理汇总了Java中org.eclipse.collections.api.list.MutableList.notEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java MutableList.notEmpty方法的具体用法?Java MutableList.notEmpty怎么用?Java MutableList.notEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.collections.api.list.MutableList的用法示例。


在下文中一共展示了MutableList.notEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateAttributes

import org.eclipse.collections.api.list.MutableList; //导入方法依赖的package包/类
private void validateAttributes(TextMarkupDocument doc) {
    ImmutableList<String> disallowedSections = doc.getSections().collect(TextMarkupDocumentSection.TO_NAME).select(Predicates.in(disallowedSectionNames));

    if (disallowedSections.notEmpty()) {
        throw new IllegalArgumentException("Found these disallowed sections: " + disallowedSections);
    }

    for (TextMarkupDocumentSection section : doc.getSections()) {
        ImmutableSet<String> disallowedAttrs = section.getAttrs().keysView().toSet().toImmutable().difference(allowedAttrs);
        ImmutableSet<String> disallowedToggles = section.getToggles().difference(allowedToggles);

        MutableList<String> errorMessages = Lists.mutable.empty();
        if (disallowedAttrs.notEmpty()) {
            errorMessages.add("Following attributes are not allowed in the " + section.getName() + " section: " + disallowedAttrs);
        }
        if (disallowedToggles.notEmpty()) {
            errorMessages.add("Following toggles are not allowed in the " + section.getName() + " section: " + disallowedToggles);
        }
        if (errorMessages.notEmpty()) {
            throw new IllegalArgumentException("Found " + errorMessages.size() + " errors in the input: " + errorMessages.makeString(";;; "));
        }
    }
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:24,代码来源:AbstractDbChangeFileParser.java

示例2: recompileInvalidObjects

import org.eclipse.collections.api.list.MutableList; //导入方法依赖的package包/类
private void recompileInvalidObjects(RichIterable<PhysicalSchema> physicalSchemas) {
    MutableList<String> warnings = Lists.mutable.empty();
    for (final PhysicalSchema physicalSchema : physicalSchemas) {
        try {
            this.stmtExecutor.executeWithinContext(physicalSchema, new Procedure<Connection>() {
                @Override
                public void value(Connection conn) {
                    stmtExecutor.getJdbcTemplate().update(conn, "CALL SYSPROC.ADMIN_REVALIDATE_DB_OBJECTS(NULL, '" + physicalSchema.getPhysicalName() + "', NULL)");
                }
            });
            LOG.info("Successfully recompiled objects in schema", physicalSchema);
        } catch (DataAccessException e) {
            warnings.add(physicalSchema.getPhysicalName() + ": " + e.getMessage());
            LOG.warn("Failed to recompile objects on schema {}; will not fail the overall deployment due to this", physicalSchema, e);
        }
    }

    if (warnings.notEmpty()) {
        deployMetricsCollector.addMetric(POST_DEPLOY_WARNINGS, "Failures on recompiling invalid objects: " + warnings.makeString("\n"));
    }
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:22,代码来源:Db2PostDeployAction.java

示例3: setupGroups

import org.eclipse.collections.api.list.MutableList; //导入方法依赖的package包/类
private void setupGroups(Connection conn, PhysicalSchema schema, boolean failOnSetupException) {
    MutableSet<String> existingGroups;
    try {
        existingGroups = ListAdapter.adapt(jdbc.query(conn, schema.getPhysicalName() + "..sp_helpgroup", new ColumnListHandler<String>("Group_name"))).toSet();
    } catch (DataAccessException e) {
        if (failOnSetupException) {
            throw e;
        } else {
            LOG.warn("Group validation query failed; continuing w/ deployment per configuration", e);
            deployMetricsCollector.addMetric(DeployMetrics.WARNINGS_PREFIX + ".aseGroupValidationQueryFailure", true);
            return;
        }
    }

    ImmutableList<Group> missingGroups = env.getGroups().select(Predicates.attributeNotIn(Group.TO_NAME, existingGroups));
    MutableList<String> failedGroups = Lists.mutable.empty();
    for (Group group : missingGroups) {
        LOG.info("Group " + group.getName() + " doesn't exist in database " + schema.getPhysicalName() + "; creating it now");
        try {
            jdbc.update(conn, schema.getPhysicalName() + "..sp_addgroup " + group.getName());
        } catch (DataAccessException sqlExc) {
            if (failOnSetupException) {
                throw new DeployerRuntimeException("Failed to create group " + group.getName() + " in database " + schema.getPhysicalName() + " during setup; exiting the deploy", sqlExc);
            } else {
                LOG.warn("Group creation failed for group {} in database {}; continuing w/ deployment per configuration", group, schema, sqlExc);
                failedGroups.add(group.getName());
            }
        }
    }

    if (failedGroups.notEmpty()) {
        deployMetricsCollector.addMetric(DeployMetrics.WARNINGS_PREFIX + ".aseGroupCreationFailure", "Failed creating groups " + failedGroups + " in database " + schema);
    }
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:35,代码来源:AseEnvironmentInfraSetup.java


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