Example usage for org.apache.commons.collections CollectionUtils EMPTY_COLLECTION

List of usage examples for org.apache.commons.collections CollectionUtils EMPTY_COLLECTION

Introduction

In this page you can find the example usage for org.apache.commons.collections CollectionUtils EMPTY_COLLECTION.

Prototype

Collection EMPTY_COLLECTION

To view the source code for org.apache.commons.collections CollectionUtils EMPTY_COLLECTION.

Click Source Link

Document

An empty unmodifiable collection.

Usage

From source file:org.wso2.carbon.identity.auth.saml2.common.X509CredentialImpl.java

@Override
public Collection<X509CRL> getCRLs() {
    return CollectionUtils.EMPTY_COLLECTION;
}

From source file:reconf.client.proxy.ConfigurationRepositoryFactory.java

public static synchronized <T> T get(Class<T> arg, Customization customization,
        Collection<? extends ConfigurationItemListener> configurationItemListeners) {
    setUpIfNeeded();/*from www .  java2  s . com*/

    if (customization == null) {
        customization = new Customization();
    }
    if (configurationItemListeners == null) {
        configurationItemListeners = Collections.EMPTY_LIST;
    }

    String key = arg.getName() + customization;
    if (cache.containsKey(key)) {
        if (CollectionUtils.isEqualCollection(configurationItemListeners, listenerCache.get(key))) {
            LoggerHolder.getLog().info(msg.format("cached.instance", arg.getName()));
            return (T) cache.get(key);
        }

        throw new IllegalArgumentException(msg.format("error.customization", arg.getName()));
    }

    ConfigurationRepositoryElement repo = Environment.getFactory().create(arg);
    repo.setCustomization(customization);
    repo.setComponent(customization.getCustomComponent(repo.getComponent()));
    repo.setProduct(customization.getCustomProduct(repo.getProduct()));
    if (configurationItemListeners != null) {
        for (ConfigurationItemListener listener : configurationItemListeners) {
            repo.addConfigurationItemListener(listener);
        }
    }

    for (ConfigurationItemElement item : repo.getConfigurationItems()) {
        item.setProduct(repo.getProduct());
        item.setComponent(customization.getCustomComponent(item.getComponent()));
        item.setValue(customization.getCustomItem(item.getValue()));
    }

    LoggerHolder.getLog().info(msg.format("new.instance", LineSeparator.value(), repo.toString()));

    Object result = newInstance(arg, repo);
    cache.put(key, result);
    listenerCache.put(key, ((configurationItemListeners != null) ? configurationItemListeners
            : CollectionUtils.EMPTY_COLLECTION));
    return (T) result;
}

From source file:uk.ac.ebi.atlas.solr.admin.index.conditions.ConditionsIndexTest.java

@Test
public void updateConditionsShouldReindexDiffExperiment() throws Exception {
    given(conditionsPropertiesBuilderMock.buildProperties(Mockito.eq(differentialExperimentMock),
            Mockito.any(SetMultimap.class))).willReturn(CollectionUtils.EMPTY_COLLECTION);
    DifferentialConditionsIndex subject = new DifferentialConditionsIndex(solrServerMock,
            conditionsPropertiesBuilderMock);

    subject.updateConditions(differentialExperimentMock, null);

    ArgumentCaptor<String> deleteQueryCaptor = ArgumentCaptor.forClass(String.class);

    verify(solrServerMock).deleteByQuery(deleteQueryCaptor.capture());
    assertThat(deleteQueryCaptor.getValue(), endsWith(EXPERIMENT_ACCESSION));

    verify(conditionsPropertiesBuilderMock).buildProperties(Mockito.eq(differentialExperimentMock),
            Mockito.any(SetMultimap.class));

    verify(solrServerMock).addBeans(CollectionUtils.EMPTY_COLLECTION);
}