Example usage for java.util Collections EMPTY_LIST

List of usage examples for java.util Collections EMPTY_LIST

Introduction

In this page you can find the example usage for java.util Collections EMPTY_LIST.

Prototype

List EMPTY_LIST

To view the source code for java.util Collections EMPTY_LIST.

Click Source Link

Document

The empty list (immutable).

Usage

From source file:com.github.nukesparrow.htmlunit.HUQueryElements.java

public HUQueryElements<?> getClickable() {
    if (!found())
        return new HUQueryElements(w, Collections.EMPTY_LIST);

    return w.getClickable(elements.get(0));
}

From source file:com.seitenbau.jenkins.plugins.dynamicparameter.util.JenkinsUtils.java

/**
 * Get the parameter definitions for the given project.
 * @param project the project for which the parameter definitions should be found
 * @return parameter definitions or an empty list
 *//* w ww . ja  v  a  2s.c  om*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static List<ParameterDefinition> getProjectParameterDefinitions(AbstractProject project) {
    ParametersDefinitionProperty parametersDefinitionProperty = (ParametersDefinitionProperty) project
            .getProperty(ParametersDefinitionProperty.class);
    if (parametersDefinitionProperty != null) {
        List<ParameterDefinition> parameterDefinitions = parametersDefinitionProperty.getParameterDefinitions();
        if (parameterDefinitions != null) {
            return parameterDefinitions;
        }
    }
    return Collections.EMPTY_LIST;
}

From source file:com.skilrock.lms.embedded.roleMgmt.common.PrivsInterceptor.java

/**
 * Splits a string into a List//from  ww  w  .  ja  v a 2s .c o m
 */
protected List<String> stringToList(String val) {
    if (val != null) {
        String[] list = val.split("[ ]*,[ ]*");
        return Arrays.asList(list);
    } else {
        return Collections.EMPTY_LIST;
    }
}

From source file:com.siemens.sw360.commonIO.ConvertRecordTest.java

@Test
public void testFillTodoCustomPropertyInfoEmpty() throws Exception {
    List<ConvertRecord.PropertyWithValueAndId> customProperties = new ArrayList<>();
    SetMultimap<Integer, Integer> todoCustomPropertyMap = HashMultimap.create();
    fillTodoCustomPropertyInfo(Collections.EMPTY_LIST, customProperties, todoCustomPropertyMap);
    assertThat(customProperties.size(), is(0));
    assertThat(todoCustomPropertyMap.size(), is(0));
}

From source file:com.github.nethad.clustermeister.provisioning.dependencymanager.DependencyConfigurationUtil.java

static void processMavenRepositories(Configuration configuration, MavenRepositorySystem repositorySystem) {

    List<Object> repoList = configuration.getList(MAVEN_REPOSITORIES, Collections.EMPTY_LIST);
    Map<String, Map<String, String>> repoSpecification = ConfigurationUtil.reduceObjectList(repoList,
            "Maven repositories must be specified as a list of objects.");
    for (Map.Entry<String, Map<String, String>> entry : repoSpecification.entrySet()) {
        String repoId = entry.getKey();
        Map<String, String> repoValues = entry.getValue();
        try {//w w  w. j  ava 2  s .  c o m
            String layout = ConfigurationUtil.getCheckedConfigValue(MAVEN_REPO_LAYOUT, repoValues,
                    "maven repository", repoId);
            String url = ConfigurationUtil.getCheckedConfigValue(MAVEN_REPO_URL, repoValues, "maven repository",
                    repoId);
            RemoteRepository repo = repositorySystem.createRemoteRepository(repoId, layout, url);
            logger.info("Adding repository for dependency resolution: {}.", repo);
            repositorySystem.addRepository(repo);
        } catch (Exception ex) {
            logger.warn("Could not process repository specification {}.", repoId, ex);
        }
    }
}

From source file:de.innovationgate.webgate.api.query.rss.WGDatabaseImpl.java

public Iterator<WGDocumentCore> getChildEntries(WGStructEntry structEntry, WGPageOrderSet order) {
    return Collections.EMPTY_LIST.iterator();
}

From source file:com.impetus.ankush.admin.service.impl.GenericManagerImplTest.java

@Test
public void testGetByPropertyValueGuarded() {
    String property = "property";
    Object value = "value";

    EasyMock.expect(/*from w w w .  j  a  v a 2  s .co m*/
            genericDao.getAllByPropertyValue(Collections.singletonMap(property, value), 0, Integer.MAX_VALUE))
            .andReturn(Collections.EMPTY_LIST);
    EasyMock.replay(genericDao);

    assertNull("null not returned", genericManager.getByPropertyValueGuarded(property, value));
}

From source file:com.gargoylesoftware.htmlunit.html.HtmlAnchorTest.java

/**
 * @throws Exception if the test fails/*  ww w .j a va  2s .c  o  m*/
 */
@Test
public void click_javascriptUrlMixedCase() throws Exception {
    final String htmlContent = "<html><head><title>foo</title></head><body>\n"
            + "<a href='JAVAscrIpt:alert(\"clicked\")' id='a2'>link to foo2</a>\n" + "</body></html>";
    final List<String> collectedAlerts = new ArrayList<>();
    final HtmlPage page = loadPage(htmlContent, collectedAlerts);

    final HtmlAnchor anchor = page.getHtmlElementById("a2");

    assertEquals(Collections.EMPTY_LIST, collectedAlerts);

    final HtmlPage secondPage = anchor.click();

    assertEquals(new String[] { "clicked" }, collectedAlerts);
    assertSame(page, secondPage);
}

From source file:com.oneops.controller.cms.CmsWoProvider.java

public List<CmsActionOrder> getBaseActionOrders(long procedureId, OpsProcedureState state, Integer execOrder) {
    checkControllerCache();/*ww w.  java  2  s  .c  o m*/
    List<CmsActionOrder> aorders = opsMapper.getActionOrders(procedureId, state, execOrder);
    List<CmsActionOrder> actionOrders = Collections.EMPTY_LIST;
    if (!aorders.isEmpty()) {
        aorders.forEach(ao -> {
            CmsCI ci = cmProcessor.getCiById(ao.getCiId());
            ao.setCi(ci);
        });
        populateWoBase(aorders);
        // this is a special case for the cloud.Service usecase
        actionOrders = aorders.stream().filter(ao -> !isCloudServiceAction(ao)).collect(Collectors.toList());
        List<CmsActionOrder> cloudServiceOrders = aorders.stream().filter(ao -> isCloudServiceAction(ao))
                .collect(Collectors.toList());

        if (!actionOrders.isEmpty()) {
            List<CmsCI> envs = Collections
                    .singletonList(getEnvAndPopulatePlatEnable(actionOrders.get(0).getBox()));
            actionOrders.forEach(ao -> ao.putPayLoadEntry("Environment", envs));
        }
        actionOrders.addAll(cloudServiceOrders);
    }
    return actionOrders;
}

From source file:com.microsoft.alm.plugin.idea.utils.ServerContextSettings.java

public List<ServerContext> getServerContextsToRestore() {
    if (restoreState == null || restoreState.serverContextItemStores == null) {
        return Collections.EMPTY_LIST;
    }//from w w w  . ja  va  2 s. co  m

    final List<ServerContext> serverContexts = new ArrayList<ServerContext>();
    for (final ServerContextItemsStore.ServerContextItemStore toRestore : restoreState.serverContextItemStores) {
        Key key = null;
        try {
            final URI serverUri = UrlHelper.getBaseUri(toRestore.uri);
            key = ServerContextStore.Key.create(serverUri);
            final AuthenticationInfo authenticationInfo = getServerContextSecrets(key);
            if (authenticationInfo != null) {
                serverContexts.add(new ServerContextBuilder().type(toRestore.type).uri(serverUri)
                        .authentication(authenticationInfo)
                        .collection(readFromJson(toRestore.teamProjectCollectionReference,
                                TeamProjectCollectionReference.class))
                        .teamProject(readFromJson(toRestore.teamProjectReference, TeamProjectReference.class))
                        .repository(readFromJson(toRestore.gitRepository, GitRepository.class)).build());
            }
        } catch (final Throwable restoreThrowable) {
            logger.warn("Failed to restore server context", restoreThrowable);
            // attempt to clean up left over data
            if (key != null) {
                try {
                    forgetServerContextSecrets(key);
                } catch (final Throwable cleanupThrowable) {
                    logger.warn("Failed to cleanup invalid server context");
                }
            }
        }
    }

    restoreState = null; // null this out since data ownership has now been passed
    return serverContexts;
}