Java Code Examples for org.apache.commons.collections.ListUtils#EMPTY_LIST
The following examples show how to use
org.apache.commons.collections.ListUtils#EMPTY_LIST .
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: GroupItem.java From openhab1-addons with Eclipse Public License 2.0 | 6 votes |
/** * The accepted command types of a group item is the same as of the underlying base item. * If none is defined, the intersection of all sets of accepted command types of all group * members is used instead. * * @return the accepted command types of this group item */ @Override @SuppressWarnings("unchecked") public List<Class<? extends Command>> getAcceptedCommandTypes() { if (baseItem != null) { return baseItem.getAcceptedCommandTypes(); } else { List<Class<? extends Command>> acceptedCommandTypes = null; for (Item item : members) { if (acceptedCommandTypes == null) { acceptedCommandTypes = item.getAcceptedCommandTypes(); } else { acceptedCommandTypes = ListUtils.intersection(acceptedCommandTypes, item.getAcceptedCommandTypes()); } } return acceptedCommandTypes == null ? ListUtils.EMPTY_LIST : acceptedCommandTypes; } }
Example 2
Source File: GroupItem.java From openhab1-addons with Eclipse Public License 2.0 | 6 votes |
/** * The accepted data types of a group item is the same as of the underlying base item. * If none is defined, the intersection of all sets of accepted data types of all group * members is used instead. * * @return the accepted data types of this group item */ @Override @SuppressWarnings("unchecked") public List<Class<? extends State>> getAcceptedDataTypes() { if (baseItem != null) { return baseItem.getAcceptedDataTypes(); } else { List<Class<? extends State>> acceptedDataTypes = null; for (Item item : members) { if (acceptedDataTypes == null) { acceptedDataTypes = item.getAcceptedDataTypes(); } else { acceptedDataTypes = ListUtils.intersection(acceptedDataTypes, item.getAcceptedDataTypes()); } } return acceptedDataTypes == null ? ListUtils.EMPTY_LIST : acceptedDataTypes; } }
Example 3
Source File: DatabaseSetEntryService.java From das with Apache License 2.0 | 5 votes |
public List<String> getNamesByEntryIds(List<Integer> dbset_ids) throws SQLException { if (CollectionUtils.isEmpty(dbset_ids)) { return ListUtils.EMPTY_LIST; } List<DatabaseSetEntry> list = dataBaseSetEntryDao.getAllDbSetEntryByDbSetIds(dbset_ids); List<String> shardings = list.stream().map(i -> i.getSharding()).collect(Collectors.toList()); return shardings; }
Example 4
Source File: XXPolicyDao.java From ranger with Apache License 2.0 | 5 votes |
public List<Long> findServiceIdsByRoleId(Long roleId) { List<Long> ret = ListUtils.EMPTY_LIST; if (roleId != null) { try { ret = getEntityManager().createNamedQuery("XXPolicy.findServiceIdsByRoleId", Long.class) .setParameter("roleId", roleId) .getResultList(); } catch (NoResultException excp) { } } return ret; }
Example 5
Source File: XXPolicyDao.java From ranger with Apache License 2.0 | 5 votes |
public List<XXPolicy> findByRoleId(Long roleId) { List<XXPolicy> ret = ListUtils.EMPTY_LIST; if (roleId != null) { try { ret = getEntityManager().createNamedQuery("XXPolicy.findByRoleId", tClass) .setParameter("roleId", roleId) .getResultList(); } catch (NoResultException excp) { } } return ret; }
Example 6
Source File: XXRoleDao.java From ranger with Apache License 2.0 | 5 votes |
public List<String> findRoleNamesByServiceId(Long serviceId) { List<String> ret; try { ret = getEntityManager() .createNamedQuery("XXRole.findRoleNamesByServiceId", String.class) .setParameter("serviceId", serviceId) .getResultList(); } catch (NoResultException e) { ret = ListUtils.EMPTY_LIST; } return ret; }
Example 7
Source File: NacosServiceDiscovery.java From spring-cloud-gray with Apache License 2.0 | 5 votes |
@Override public List<InstanceInfo> listInstanceInfos(String serviceId) { List<Instance> instances = null; try { instances = discoveryProperties.namingServiceInstance().getAllInstances(serviceId, false); } catch (NacosException e) { log.error(e.getMessage(), e); return ListUtils.EMPTY_LIST; } return instances.stream().map(this::createInstanceInfo).collect(Collectors.toList()); }
Example 8
Source File: RoleDBStore.java From ranger with Apache License 2.0 | 5 votes |
public List<RangerRole> getRoles(Long serviceId) { List<RangerRole> ret = ListUtils.EMPTY_LIST; if (serviceId != null) { String serviceTypeName = daoMgr.getXXServiceDef().findServiceDefTypeByServiceId(serviceId); if (LOG.isDebugEnabled()) { LOG.debug("Service Type for serviceId (" + serviceId + ") = " + serviceTypeName); } String serviceTypesToGetAllRoles = config.get("ranger.admin.service.types.for.returning.all.roles", "solr"); boolean getAllRoles = false; if (StringUtils.isNotEmpty(serviceTypesToGetAllRoles)) { String[] allRolesServiceTypes = StringUtils.split(serviceTypesToGetAllRoles, ","); if (allRolesServiceTypes != null) { for (String allRolesServiceType : allRolesServiceTypes) { if (StringUtils.equalsIgnoreCase(serviceTypeName, allRolesServiceType)) { getAllRoles = true; break; } } } } List<XXRole> rolesFromDb = getAllRoles ? daoMgr.getXXRole().getAll() : daoMgr.getXXRole().findByServiceId(serviceId); if (CollectionUtils.isNotEmpty(rolesFromDb)) { ret = new ArrayList<>(); for (XXRole xxRole : rolesFromDb) { ret.add(roleService.read(xxRole.getId())); } } } return ret; }
Example 9
Source File: StringUtil.java From das with Apache License 2.0 | 5 votes |
public static List<Long> toLongList(List<String> values) { List<Long> rs = new ArrayList<>(); if (CollectionUtils.isNotEmpty(values)) { for (String str : values) { rs.add(Long.valueOf(str)); } return rs; } return ListUtils.EMPTY_LIST; }
Example 10
Source File: StringUtil.java From das with Apache License 2.0 | 5 votes |
/** * "a,b,c,d ---> [a,b,c,d]" */ public static List<Long> toLongList(String values) { if (StringUtils.isNotBlank(values)) { List<String> list = toList(values, ","); return toLongList(list); } return ListUtils.EMPTY_LIST; }
Example 11
Source File: StringUtil.java From das with Apache License 2.0 | 5 votes |
/** * "a,b,c,d ---> [a,b,c,d]" */ public static List<String> toList(String values) { if (StringUtils.isNotBlank(values)) { return toList(values, ","); } return ListUtils.EMPTY_LIST; }
Example 12
Source File: ProjectCloudService.java From das with Apache License 2.0 | 5 votes |
public List<String> getAppidListByWorkName(String workname) throws SQLException { if (StringUtils.isBlank(workname)) { return ListUtils.EMPTY_LIST; } List<ProjectCloudView> list = projectCloudDao.getProjectsByWorkName(workname); return list.stream().map(i -> i.getApp_id()).collect(Collectors.toList()); }
Example 13
Source File: RangerDefaultService.java From ranger with Apache License 2.0 | 5 votes |
@Override public List<String> lookupResource(ResourceLookupContext context) throws Exception { if(LOG.isDebugEnabled()) { LOG.debug("RangerDefaultService.lookupResource Context: (" + context + "), returning empty list"); } return ListUtils.EMPTY_LIST; }
Example 14
Source File: StringUtil.java From das with Apache License 2.0 | 4 votes |
public static List<String> toList(String values, String separator) { if (StringUtils.isNotBlank(values)) { return Splitter.on(separator).omitEmptyStrings().trimResults().splitToList(values); } return ListUtils.EMPTY_LIST; }
Example 15
Source File: PageUtil.java From beihu-boot with Apache License 2.0 | 4 votes |
public static <T> PageResult empty(int index, int size) { return new PageResult<T>(ListUtils.EMPTY_LIST, index, size, 0L); }
Example 16
Source File: RangerPolicyEngineImpl.java From ranger with Apache License 2.0 | 4 votes |
@Override public List<RangerPolicy> getTagPolicies() { RangerPolicyRepository tagPolicyRepository = policyEngine.getTagPolicyRepository(); return tagPolicyRepository == null ? ListUtils.EMPTY_LIST : tagPolicyRepository.getPolicies(); }
Example 17
Source File: RoleDBStore.java From ranger with Apache License 2.0 | 4 votes |
public List<RangerRole> getRoles(XXService service) { return service == null ? ListUtils.EMPTY_LIST : getRoles(service.getId()); }
Example 18
Source File: PolicyEngine.java From ranger with Apache License 2.0 | 4 votes |
public List<RangerPolicy> getResourcePolicies(String zoneName) { RangerPolicyRepository zoneResourceRepository = zonePolicyRepositories.get(zoneName); return zoneResourceRepository == null ? ListUtils.EMPTY_LIST : zoneResourceRepository.getPolicies(); }
Example 19
Source File: DbSetManager.java From das with Apache License 2.0 | 4 votes |
@Override public List<ConfigDataResponse> getAllCheckData(LoginUser user, DasGroup dasGroup, DatabaseSet dbset) { return ListUtils.EMPTY_LIST; }
Example 20
Source File: RangerPolicyEngineImpl.java From ranger with Apache License 2.0 | 4 votes |
@Override public List<RangerPolicy> getResourcePolicies() { RangerPolicyRepository policyRepository = policyEngine.getPolicyRepository(); return policyRepository == null ? ListUtils.EMPTY_LIST : policyRepository.getPolicies(); }