本文整理汇总了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(";;; "));
}
}
}
示例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"));
}
}
示例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);
}
}