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


Java PermissionCheckedCollectionMixin类代码示例

本文整理汇总了Java中org.alfresco.repo.security.permissions.PermissionCheckedCollection.PermissionCheckedCollectionMixin的典型用法代码示例。如果您正苦于以下问题:Java PermissionCheckedCollectionMixin类的具体用法?Java PermissionCheckedCollectionMixin怎么用?Java PermissionCheckedCollectionMixin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PermissionCheckedCollectionMixin类属于org.alfresco.repo.security.permissions.PermissionCheckedCollection包,在下文中一共展示了PermissionCheckedCollectionMixin类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testBasicWrapping

import org.alfresco.repo.security.permissions.PermissionCheckedCollection.PermissionCheckedCollectionMixin; //导入依赖的package包/类
public void testBasicWrapping() throws Exception
{
    List<Integer> list = new ArrayList<Integer>();
    list.add(1);
    list.add(2);
    list.add(3);
    
    final boolean isCutOff = true;
    final int sizeUnchecked = 100;
    final int sizeOriginal = 900;
    
    Collection<Integer> proxiedList = PermissionCheckedCollectionMixin.create(
            list, isCutOff, sizeUnchecked, sizeOriginal);
    
    // Check
    assertTrue("Proxied object must still be a List", proxiedList instanceof List);
    assertEquals("List values incorrect", 3, proxiedList.size());
    assertTrue("Proxied object must also be a PermissionCheckedCollection", proxiedList instanceof PermissionCheckedCollection);
    @SuppressWarnings("unchecked")
    PermissionCheckedCollection<String> proxiedPermissionCheckedCollection = (PermissionCheckedCollection<String>) proxiedList;
    assertEquals("cutOff value incorrect", isCutOff, proxiedPermissionCheckedCollection.isCutOff());
    assertEquals("sizeUnchecked value incorrect", sizeUnchecked, proxiedPermissionCheckedCollection.sizeUnchecked());
    assertEquals("sizeOriginal value incorrect", sizeOriginal, proxiedPermissionCheckedCollection.sizeOriginal());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:PermissionCheckedCollectionTest.java

示例2: getPagingResults

import org.alfresco.repo.security.permissions.PermissionCheckedCollection.PermissionCheckedCollectionMixin; //导入依赖的package包/类
private PagingResults<FileInfo> getPagingResults(PagingRequest pagingRequest, final CannedQueryResults<NodeRef> results)
{
    List<NodeRef> nodeRefs = null;
    if (results.getPageCount() > 0)
    {
        nodeRefs = results.getPages().get(0);
    }
    else
    {
        nodeRefs = Collections.emptyList();
    }
    
    // set total count
    final Pair<Integer, Integer> totalCount;
    if (pagingRequest.getRequestTotalCountMax() > 0)
    {
        totalCount = results.getTotalResultCount();
    }
    else
    {
        totalCount = null;
    }
    
    final List<FileInfo> nodeInfos = new ArrayList<FileInfo>(nodeRefs.size());
    for (NodeRef nodeRef : nodeRefs)
    {
        nodeInfos.add(toFileInfo(nodeRef, true));
    }
    PermissionCheckedCollectionMixin.create(nodeInfos, nodeRefs);
    
    return new PagingResults<FileInfo>()
    {
        @Override
        public String getQueryExecutionId()
        {
            return results.getQueryExecutionId();
        }
        @Override
        public List<FileInfo> getPage()
        {
            return nodeInfos;
        }
        @Override
        public boolean hasMoreItems()
        {
            return results.hasMoreItems();
        }
        @Override
        public Pair<Integer, Integer> getTotalResultCount()
        {
            return totalCount;
        }
    };        
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:55,代码来源:FileFolderServiceImpl.java


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