Example usage for org.apache.commons.collections ListUtils EMPTY_LIST

List of usage examples for org.apache.commons.collections ListUtils EMPTY_LIST

Introduction

In this page you can find the example usage for org.apache.commons.collections ListUtils EMPTY_LIST.

Prototype

List EMPTY_LIST

To view the source code for org.apache.commons.collections ListUtils EMPTY_LIST.

Click Source Link

Document

An empty unmodifiable list.

Usage

From source file:com.cognizant.orchestrator.resource.AbstractResourceManager.java

@Override
public List getVM() {
    // TODO Auto-generated method stub
    return ListUtils.EMPTY_LIST;
}

From source file:net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser.java

public AbstractMemoryMapParser() {
    this.patterns = ListUtils.EMPTY_LIST;
}

From source file:com.emergya.persistenceGeo.dao.impl.LayerTypeEntityDaoHibernateImpl.java

public List<AbstractLayerTypePropertyEntity> getLayerTypeProperties(String layerTypeName) {
    List<AbstractLayerTypeEntity> result = getSession().createCriteria(persistentClass)
            .add(Restrictions.eq("name", layerTypeName)).list();
    return (result != null && result.size() > 0) ? result.get(0).getDefaultProperties() : ListUtils.EMPTY_LIST;
}

From source file:com.synopsys.arc.jenkins.plugins.ownership.nodes.ComputerOwnerHelper.java

@Override
public Collection<User> getPossibleOwners(@Nonnull Computer computer) {
    Node node = computer.getNode();
    return node != null ? NodeOwnerHelper.Instance.getPossibleOwners(node) : ListUtils.EMPTY_LIST;
}

From source file:net.mindengine.oculus.frontend.web.controllers.report.ReportBrowseController.java

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override/*w  ww.j a  va  2  s  .c o  m*/
protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception {
    Session session = Session.create(request);
    SearchFilter filter = (SearchFilter) command;

    filter.setColumnList(columnFactory.getColumnList());

    Map referenceData = new HashMap();
    List statuses = new ArrayList<Option>();

    List filterTCStatusList = null;

    if (filter != null) {
        filterTCStatusList = filter.getTestCaseStatusList();
    }

    if (filterTCStatusList == null) {
        filterTCStatusList = ListUtils.EMPTY_LIST;
    }

    statuses.add(new Option("PASSED", "<img src=\"../images/filter-passed.png\"/>Passed",
            filterTCStatusList.contains("PASSED")));
    statuses.add(new Option("WARNING", "<img src=\"../images/filter-warning.png\"/>Warning",
            filterTCStatusList.contains("WARNING")));
    statuses.add(new Option("FAILED", "<img src=\"../images/filter-failed.png\"/>Failed",
            filterTCStatusList.contains("FAILED")));

    referenceData.put("testCaseStatusList", statuses);
    referenceData.put("columnFactory", columnFactory);

    referenceData.put("savedTestRunList", session.getCollectedTestRuns());
    referenceData.put("savedTestRunListCount", session.getCollectedTestRuns().size());

    referenceData.put("rootProjects", projectDAO.getRootProjects());
    referenceData.put("title", getTitle());
    return referenceData;
}

From source file:com.baifendian.swordfish.common.job.struct.node.mr.MrParam.java

/**
 * @return//  www  . ja v a2s .  co  m
 */
public List<String> getDArgs() {
    if (CollectionUtils.isEmpty(properties)) {
        return ListUtils.EMPTY_LIST;
    }

    return properties.stream().map(prop -> prop.getProp() + "=" + prop.getValue()).collect(Collectors.toList());
}

From source file:com.emergya.persistenceGeo.web.RestZoneController.java

/**
 * Get all zones in a zone//from  ww  w . j  ava 2 s . co m
 *
 * @param idZone id zone to obtain children or null if you want all zones
 *
 * @return all zones if idZone is null or child zones of idZone otherwise
 */
@RequestMapping(value = "/persistenceGeo/getAllZones", method = RequestMethod.GET)
public @ResponseBody Map<String, Object> getAllZones(
        @RequestParam(value = "idZone", required = false) String idZone) {
    Map<String, Object> result = new HashMap<String, Object>();
    List<ZoneDto> zones = null;
    try {
        if (idZone == null) {
            zones = (List<ZoneDto>) zoneAdminService.findAllEnabled();
        } else {
            zones = (List<ZoneDto>) zoneAdminService.findByParent(Long.decode(idZone), Boolean.TRUE);
        }
        result.put(SUCCESS, true);
    } catch (Exception e) {
        result.put(SUCCESS, false);
    }
    result.put(RESULTS, zones != null ? zones.size() : 0);
    result.put(ROOT, zones != null ? zones : ListUtils.EMPTY_LIST);

    return result;
}

From source file:com.synopsys.arc.jenkins.plugins.ownership.util.AbstractOwnershipHelper.java

@Override
public Collection<User> getPossibleOwners(TObjectType item) {
    return ListUtils.EMPTY_LIST;
}

From source file:com.redhat.rhn.manager.system.UpdateBaseChannelCommand.java

/**
 * {@inheritDoc}/*  w w w . j  a  v  a2 s.c o m*/
 */
public ValidatorError store() {
    Channel oldChannel = server.getBaseChannel();
    Channel newChannel = null;

    // if new channel equals old, there's nothing to do
    if ((oldChannel == null && baseChannelId.longValue() == -1)
            || (oldChannel != null && oldChannel.getId() == baseChannelId.longValue())) {
        return null;
    }

    // If the new ID is -1 we are unsubscribing to a no-base-channel
    // for the server.
    if (baseChannelId.longValue() != -1) {
        newChannel = ChannelManager.lookupByIdAndUser(new Long(baseChannelId.longValue()), user);
        // Make sure we got a valid base channel from the user
        if (newChannel == null || newChannel.getParentChannel() != null
                || !newChannel.getChannelArch().isCompatible(server.getServerArch())) {
            throw new InvalidChannelException();
        }
    }

    // Check for available subs
    if (newChannel != null && !SystemManager.canServerSubscribeToChannel(user.getOrg(), server, newChannel)) {
        return new ValidatorError("system.channel.nochannelslots");
    }
    List<Long> newKidsToSubscribe = new LinkedList<Long>();

    if (oldChannel != null && newChannel != null) {
        Map<Channel, Channel> preservableChildren = ChannelManager.findCompatibleChildren(oldChannel,
                newChannel, user);
        for (Channel kid : server.getChannels()) {
            if (preservableChildren.containsKey(kid)) {
                newKidsToSubscribe.add(preservableChildren.get(kid).getId());
            }
        }
    }

    // First unsubscribe all the child channels
    UpdateChildChannelsCommand cmd = new UpdateChildChannelsCommand(user, server, ListUtils.EMPTY_LIST);
    cmd.store();

    // Unsubscribe the server from it's current base channel
    try {
        SystemManager.unsubscribeServerFromChannel(user, server, oldChannel);
    } catch (PermissionException e) {
        // convert to FaultException
        throw new PermissionCheckFailureException();
    }

    if (newChannel != null) {
        // Subscribe the server to the new base channel
        try {
            SystemManager.subscribeServerToChannel(user, server, newChannel);
            cmd = new UpdateChildChannelsCommand(user, server, newKidsToSubscribe);
            cmd.store();

        } catch (PermissionException e) {
            // convert to FaultException
            throw new PermissionCheckFailureException();
        }
    }
    return super.store();
}

From source file:com.emergya.persistenceGeo.web.RestZoneController.java

/**
 * Get all zones of a specific type/*w  w w  .  j  a v  a 2  s  .c  o  m*/
 *
 * @param type Type of the zone
 *
 * @return all zones of a specified type
 */
@RequestMapping(value = "/persistenceGeo/getZonesByType", method = RequestMethod.GET)
public @ResponseBody Map<String, Object> getZonesByType(
        @RequestParam(value = "type", required = true) String zoneType) {
    Map<String, Object> result = new HashMap<String, Object>();
    List<ZoneDto> zones = null;
    try {
        zones = (List<ZoneDto>) zoneAdminService.findByType(zoneType, true);
        result.put(SUCCESS, true);
    } catch (Exception e) {
        result.put(SUCCESS, false);
    }
    result.put(RESULTS, zones != null ? zones.size() : 0);
    result.put(ROOT, zones != null ? zones : ListUtils.EMPTY_LIST);

    return result;
}