本文整理了Java中org.apache.commons.collections4.CollectionUtils.sizeIsEmpty()
方法的一些代码示例,展示了CollectionUtils.sizeIsEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CollectionUtils.sizeIsEmpty()
方法的具体详情如下:
包路径:org.apache.commons.collections4.CollectionUtils
类名称:CollectionUtils
方法名:sizeIsEmpty
[英]Checks if the specified collection/array/iterator is empty.
This method can handles objects as follows
Note: This method is named to avoid clashing with #isEmpty(Collection).
[中]检查指定的集合/数组/迭代器是否为空。
此方法可以按如下方式处理对象
*集合-通过集合isEmpty
*地图-通过地图是空的
*数组-使用数组大小
*迭代器-通过hasNext
*枚举-通过hasMoreElements
注意:命名此方法是为了避免与#isEmpty(集合)冲突。
代码示例来源:origin: metatron-app/metatron-discovery
@HandleBeforeLinkDelete
@PreAuthorize("hasAuthority('PERM_SYSTEM_MANAGE_DATASOURCE')")
public void handleBeforeLinkDelete(DataConnection dataConnection, Object linked) {
// 연결된 워크스페이스 개수 처리,
// 전체 공개 워크스페이스가 아니고 linked 내 Entity 타입이 Workspace 인 경우
if(BooleanUtils.isNotTrue(dataConnection.getPublished()) &&
!CollectionUtils.sizeIsEmpty(linked) &&
CollectionUtils.get(linked, 0) instanceof Workspace) {
dataConnection.setLinkedWorkspaces(dataConnection.getWorkspaces().size());
LOGGER.debug("DELETED: Set linked workspace in datasource({}) : {}", dataConnection.getId(), dataConnection.getLinkedWorkspaces());
}
}
代码示例来源:origin: metatron-app/metatron-discovery
@HandleBeforeLinkDelete
@PreAuthorize("hasAuthority('PERM_SYSTEM_MANAGE_DATASOURCE')")
public void handleBeforeLinkDelete(DataSource dataSource, Object linked) {
// 연결된 워크스페이스 개수 처리,
// 전체 공개 워크스페이스가 아니고 linked 내 Entity 타입이 Workspace 인 경우
if (BooleanUtils.isNotTrue(dataSource.getPublished()) &&
!CollectionUtils.sizeIsEmpty(linked) &&
CollectionUtils.get(linked, 0) instanceof Workspace) {
dataSource.setLinkedWorkspaces(dataSource.getWorkspaces().size());
LOGGER.debug("DELETED: Set linked workspace in datasource({}) : {}", dataSource.getId(), dataSource.getLinkedWorkspaces());
}
}
代码示例来源:origin: metatron-app/metatron-discovery
@HandleBeforeLinkDelete
// @PreAuthorize("hasAnyAuthority('PERM_SYSTEM_WRITE_USER') " +
// "or hasPermission(#roleSet, 'PERM_WORKSPACE_WRITE_MEMBER')")
public void handleBeforeLinkDelete(RoleSet roleSet, Object linked) {
// 연결된 워크스페이스 개수 처리,
// 전체 공개 워크스페이스가 아니고 linked 내 Entity 타입이 Workspace 인 경우
if (roleSet.getScope() == RoleSet.RoleSetScope.PUBLIC &&
!CollectionUtils.sizeIsEmpty(linked) &&
CollectionUtils.get(linked, 0) instanceof Workspace) {
roleSet.setLinkedWorkspaces(roleSet.getWorkspaces().size());
LOGGER.debug("DELETED: Set linked workspace in roleset({}) : {}", roleSet.getId(), roleSet.getLinkedWorkspaces());
}
}
代码示例来源:origin: net.sourceforge.ondex.modules/rdf-export-2
if ( sizeIsEmpty ( rel.getAttributes () ) && sizeIsEmpty ( rel.getEvidence () ) && sizeIsEmpty ( rel.getTags () ) )
内容来源于网络,如有侵权,请联系作者删除!