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


Java ListUtils.isEqualList方法代码示例

本文整理汇总了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));
    // ------------------------ 
}
 
开发者ID:apache,项目名称:syncope,代码行数:24,代码来源:Relationships.java

示例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);
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:13,代码来源:AbstractListValuedMap.java

示例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;
}
 
开发者ID:garethahealy,项目名称:karaf-commands,代码行数:39,代码来源:EnsembleHealthyAction.java

示例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));
    }
    // ------------------
}
 
开发者ID:apache,项目名称:syncope,代码行数:32,代码来源:AuxClasses.java

示例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;
}
 
开发者ID:ZupCat,项目名称:simple-datastore,代码行数:41,代码来源:DatastoreEntity.java

示例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));
}
 
开发者ID:apache,项目名称:syncope,代码行数:42,代码来源:Roles.java


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