本文整理汇总了Java中org.apache.commons.collections4.ListUtils.isEqualList方法的典型用法代码示例。如果您正苦于以下问题:Java ListUtils.isEqualList方法的具体用法?Java ListUtils.isEqualList怎么用?Java ListUtils.isEqualList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.collections4.ListUtils
的用法示例。
在下文中一共展示了ListUtils.isEqualList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Relationships
import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
public Relationships(final AnyWrapper<?> modelObject, final PageReference pageRef) {
super();
add(new Label("title", new ResourceModel("any.relationships")));
if (modelObject instanceof UserWrapper
&& UserWrapper.class.cast(modelObject).getPreviousUserTO() != null
&& !ListUtils.isEqualList(
UserWrapper.class.cast(modelObject).getInnerObject().getRelationships(),
UserWrapper.class.cast(modelObject).getPreviousUserTO().getRelationships())) {
add(new LabelInfo("changed", StringUtils.EMPTY));
} else {
add(new Label("changed", StringUtils.EMPTY));
}
this.anyTO = modelObject.getInnerObject();
this.pageRef = pageRef;
// ------------------------
// Existing relationships
// ------------------------
add(getViewFragment().setRenderBodyOnly(true));
// ------------------------
}
示例2: equals
import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object other) {
final List<V> list = getMapping();
if (list == null) {
return Collections.emptyList().equals(other);
}
if (!(other instanceof List)) {
return false;
}
List<?> otherList = (List<?>) other;
return ListUtils.isEqualList(list, otherList);
}
示例3: waitForEnsembleHealthy
import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
protected Boolean waitForEnsembleHealthy() throws InterruptedException {
Boolean hasTimedOut = false;
Long currentTime = System.nanoTime();
Long waitTimeout = currentTime + TimeUnit.MILLISECONDS.toNanos(wait);
while (!hasTimedOut) {
List<String> containersInEnsemble = clusterService.getEnsembleContainers();
//Sort them to be alphabetical
Collections.sort(containersInEnsemble);
Boolean isEqualList = ListUtils.isEqualList(containers, containersInEnsemble);
if (isEqualList) {
log.trace("MATCH: Expected: {}, Result: {}", StringUtils.join(containers, ','), StringUtils.join(containersInEnsemble, ','));
System.out.println(String.format(FORMAT, "Ensemble List: ", StringUtils.join(containersInEnsemble, ',')));
System.out.println("Ensemble Healthy: success");
break;
} else {
log.trace("NON-MATCH: Expected: {}, Result: {}. Waiting...", StringUtils.join(containers, ','), StringUtils.join(containersInEnsemble, ','));
}
currentTime = System.nanoTime();
if (currentTime > waitTimeout) {
log.trace("Ensemble of {} took too long. Current time {}ns is greater than wait {}ns", StringUtils.join(containers, ','), currentTime, waitTimeout);
hasTimedOut = true;
break;
}
//Probably not the best way, but does its job
TimeUnit.MILLISECONDS.sleep(tick);
}
return hasTimedOut;
}
示例4: AuxClasses
import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
public <T extends AnyTO> AuxClasses(final AnyWrapper<T> modelObject, final List<String> anyTypeClasses) {
super();
setOutputMarkupId(true);
List<AnyTypeClassTO> allAnyTypeClasses = new AnyTypeClassRestClient().list();
List<String> choices = new ArrayList<>();
for (AnyTypeClassTO aux : allAnyTypeClasses) {
if (!anyTypeClasses.contains(aux.getKey())) {
choices.add(aux.getKey());
}
}
Collections.sort(choices);
add(new AjaxPalettePanel.Builder<String>().setAllowOrder(true).build("auxClasses",
new PropertyModel<List<String>>(modelObject.getInnerObject(), "auxClasses"),
new ListModel<>(choices)).hideLabel().setOutputMarkupId(true));
// ------------------
// insert changed label if needed
// ------------------
if (modelObject instanceof UserWrapper
&& UserWrapper.class.cast(modelObject).getPreviousUserTO() != null
&& !ListUtils.isEqualList(
modelObject.getInnerObject().getAuxClasses(),
UserWrapper.class.cast(modelObject).getPreviousUserTO().getAuxClasses())) {
add(new LabelInfo("changed", StringUtils.EMPTY));
} else {
add(new Label("changed", StringUtils.EMPTY));
}
// ------------------
}
示例5: comparePropertiesWith
import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
private boolean comparePropertiesWith(final DatastoreEntity anotherDatastoreEntity) {
if (anotherDatastoreEntity == null) {
return false;
}
if (this.propertiesMetadata.size() != anotherDatastoreEntity.propertiesMetadata.size()) {
return false;
}
if (this.propertiesMetadata.isEmpty()) {
return true;
}
for (final Map.Entry<String, PropertyMeta> myEntries : this.propertiesMetadata.entrySet()) {
final PropertyMeta anotherPropertyMeta = anotherDatastoreEntity.propertiesMetadata.get(myEntries.getKey());
if (anotherPropertyMeta == null) {
return false;
}
final PropertyMeta object1Property = myEntries.getValue();
final Object object1 = object1Property.get();
final Object object2 = anotherPropertyMeta.get();
if (object1Property instanceof ByteArrayProperty) {
if (!ArrayUtils.isEquals(object1, object2)) {
return false;
}
} else if (object1Property instanceof ListProperty) {
if (!ListUtils.isEqualList((Collection<?>) object1, (Collection<?>) object2)) {
return false;
}
} else {
if (!Objects.equals(object1, object2)) {
return false;
}
}
}
return true;
}
示例6: Roles
import org.apache.commons.collections4.ListUtils; //导入方法依赖的package包/类
public <T extends AnyTO> Roles(final AnyWrapper<?> modelObject) {
if (!(modelObject.getInnerObject() instanceof UserTO)) {
throw new IllegalStateException("Invalid instance " + modelObject.getInnerObject());
}
if (UserWrapper.class.cast(modelObject).getPreviousUserTO() != null
&& !ListUtils.isEqualList(
UserWrapper.class.cast(modelObject).getInnerObject().getRoles(),
UserWrapper.class.cast(modelObject).getPreviousUserTO().getRoles())) {
add(new LabelInfo("changed", StringUtils.EMPTY));
} else {
add(new Label("changed", StringUtils.EMPTY));
}
final UserTO entityTO = UserTO.class.cast(modelObject.getInnerObject());
// -----------------------------------------------------------------
// Pre-Authorizations
// -----------------------------------------------------------------
final ActionPermissions permissions = new ActionPermissions();
setMetaData(MetaDataRoleAuthorizationStrategy.ACTION_PERMISSIONS, permissions);
permissions.authorize(RENDER,
new org.apache.wicket.authroles.authorization.strategies.role.Roles(StandardEntitlement.ROLE_LIST));
// -----------------------------------------------------------------
this.setOutputMarkupId(true);
allRoles = SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().
isActionAuthorized(this, RENDER)
? new RoleRestClient().list().stream().map(EntityTO::getKey).collect(Collectors.toList())
: Collections.<String>emptyList();
Collections.sort(allRoles);
add(new AjaxPalettePanel.Builder<String>().build("roles",
new PropertyModel<List<String>>(entityTO, "roles"),
new ListModel<>(allRoles)).hideLabel().setOutputMarkupId(true));
add(new AjaxPalettePanel.Builder<String>().build("dynroles",
new PropertyModel<List<String>>(entityTO, "dynRoles"),
new ListModel<>(allRoles)).hideLabel().setEnabled(false).setOutputMarkupId(true));
}