Java Code Examples for org.apache.commons.lang3.EnumUtils#getEnumList()
The following examples show how to use
org.apache.commons.lang3.EnumUtils#getEnumList() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserRoleManage.java From bbs with GNU Affero General Public License v3.0 | 6 votes |
/** * 处理标签资源 * @param resourceGroupCode 资源组编号 * @return */ private List<UserResource> processingTagResource(Integer resourceGroupCode){ List<UserResource> userResourceList = new ArrayList<UserResource>(); List<ResourceEnum> resourceEnumList = EnumUtils.getEnumList(ResourceEnum.class); if(resourceEnumList != null && resourceEnumList.size() >0){ for(ResourceEnum resourceEnum: resourceEnumList){ if(resourceEnum.getResourceGroupCode().equals(resourceGroupCode)){ UserResource userResource = new UserResource(); userResource.setCode(resourceEnum.getCode()); userResource.setName(resourceEnum.getName()); userResource.setResourceGroupCode(resourceEnum.getResourceGroupCode()); userResourceList.add(userResource); } } } return userResourceList; }
Example 2
Source File: FilterableEnumUtils.java From synopsys-detect with Apache License 2.0 | 5 votes |
public static <T extends Enum<T>> List<T> populatedValues(@NotNull List<FilterableEnumValue<T>> filterableList, Class<T> enumClass) { if (FilterableEnumUtils.containsNone(filterableList)) { return new ArrayList<>(); } else if (FilterableEnumUtils.containsAll(filterableList)) { return EnumUtils.getEnumList(enumClass); } else { return FilterableEnumUtils.toPresentValues(filterableList); } }
Example 3
Source File: EnumPropertyUtils.java From synopsys-detect with Apache License 2.0 | 4 votes |
public static <T extends Enum<T>> List<String> getEnumNames(Class<T> enumClass) { final List<T> values = new ArrayList<>(EnumUtils.getEnumList(enumClass)); return values.stream() .map(Objects::toString) .collect(Collectors.toList()); }
Example 4
Source File: UserRoleManage.java From bbs with GNU Affero General Public License v3.0 | 4 votes |
/** * 读取所有用户资源组 * @return */ public List<UserResourceGroup> readAllUserResourceGroup(){ List<UserResourceGroup> userResourceGroupList = new ArrayList<UserResourceGroup>(); List<ResourceGroupEnum> resourceGroupEnumList = EnumUtils.getEnumList(ResourceGroupEnum.class); if(resourceGroupEnumList != null && resourceGroupEnumList.size() >0){ for(ResourceGroupEnum resourceGroupEnum: resourceGroupEnumList){ if(resourceGroupEnum.getType().equals(20)){//需'预处理'类型资源组 userResourceGroupList.addAll(this.processingTagResourceGroup(resourceGroupEnum)); }else{//'直接提交'类型资源组 UserResourceGroup userResourceGroup = new UserResourceGroup(); userResourceGroup.setCode(resourceGroupEnum.getCode()); userResourceGroup.setName(resourceGroupEnum.getName()); userResourceGroup.setType(resourceGroupEnum.getType()); List<ResourceEnum> resourceEnumList = EnumUtils.getEnumList(ResourceEnum.class); if(resourceEnumList != null && resourceEnumList.size() >0){ for(ResourceEnum resourceEnum : resourceEnumList){ if(resourceEnum.getResourceGroupCode().equals(userResourceGroup.getCode())){ UserResource userResource = new UserResource(); userResource.setCode(resourceEnum.getCode()); userResource.setName(resourceEnum.getName()); userResource.setResourceGroupCode(resourceEnum.getResourceGroupCode()); userResourceGroup.addUserResource(userResource); } } } userResourceGroupList.add(userResourceGroup); } } } return userResourceGroupList; }
Example 5
Source File: LeaseItemType.java From estatio with Apache License 2.0 | 4 votes |
public static List<LeaseAgreementRoleTypeEnum> invoicedByForLeaseTermForServiceCharge(){ return EnumUtils.getEnumList(LeaseAgreementRoleTypeEnum.class); }
Example 6
Source File: MavenArtifactNotifierCoreTaskManagementConfig.java From artifact-listener with Apache License 2.0 | 4 votes |
@Override @Bean public Collection<? extends IQueueId> queueIds() { return EnumUtils.getEnumList(MavenArtifactNotifierTaskQueueId.class); }