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:hudson.util.spring.DefaultBeanConfiguration.java

public DefaultBeanConfiguration(String name2, boolean prototype) {
    this(name2, null, Collections.EMPTY_LIST);
    this.singleton = !prototype;
}

From source file:org.apache.xmlgraphics.util.ClasspathResource.java

/**
     * Retrieve a list of resources known to have the given mime-type.
     * //from   ww w .j  a  v  a2  s. c  o  m
     * @param mimeType
     *            the mime-type to search for.
     * @return a List<URL>, guaranteed to be != null.
     */
    public List listResourcesOfMimeType(final String mimeType) {
        final List content = (List) contentMappings.get(mimeType);
        if (content == null) {
            return Collections.EMPTY_LIST;
        } else {
            return content;
        }
    }

From source file:org.openmrs.module.patientaccesscontrol.api.impl.RoleProgramServiceImpl.java

@SuppressWarnings("unchecked")
@Override/*from  w  w w. ja v  a2s  .  co  m*/
@Transactional(readOnly = true)
public List<Integer> getExplicitlyIncludedPatients() {
    return dao.getIncludedPatients(null, null, Collections.EMPTY_LIST, false, getPrograms());
}

From source file:com.mothsoft.alexis.web.ListDocumentsBackingBean.java

@SuppressWarnings("unchecked")
private void init() {
    synchronized (this) {
        if (this.dataRange == null) {
            this.pageNumber = readPage();
            this.filter = readFilter();

            final int start = this.pageNumber * PAGE_SIZE;

            final Long userId = CurrentUserUtil.getCurrentUserId();

            if (Filter.ALL.equals(filter)) {
                this.dataRange = this.documentService.listDocumentsByOwner(userId, start, PAGE_SIZE);
            } else if (Filter.SEARCH.equals(filter)) {
                try {
                    final String query = getSearchString();
                    this.dataRange = toDocumentList(this.documentService.searchByOwnerAndExpression(userId,
                            query, getSortOrder(), start, PAGE_SIZE));
                } catch (final QueryException queryException) {
                    this.dataRange = new DataRange<Document>(Collections.EMPTY_LIST, 0, 0);
                    this.queryValidationError = true;
                    return;
                }//from ww w . j av a  2s .  c o  m
            } else {
                this.dataRange = this.documentService.listDocumentsInTopicsByOwner(userId, start, PAGE_SIZE);
            }

            this.topicDocuments = new HashMap<Long, List<TopicDocument>>();

            for (final Document ith : this.dataRange.getRange()) {
                this.topicDocuments.put(ith.getId(), this.documentService.getTopicDocuments(ith.getId()));
            }
        }
    }

}

From source file:io.fabric8.maven.core.util.OpenShiftDependencyResources.java

private <T> List<T> notNullList(List<T> list) {
    if (list == null) {
        return Collections.EMPTY_LIST;
    } else {//from  w w  w.  ja  va  2 s .c o  m
        return list;
    }
}

From source file:com.dianping.swallow.broker.monitor.DefaultNotifyService.java

@SuppressWarnings("unchecked")
private List<String> getPhoneNums() throws LionException {
    String smsToStr = ConfigCache.getInstance(EnvZooKeeperConfig.getZKAddress()).getProperty(KEY_SMS_TO);
    if (smsToStr != null && smsToStr.trim().length() > 0) {
        return Arrays.asList(smsToStr.split(","));
    } else {//from   w ww  . j  a v a  2s .c om
        return Collections.EMPTY_LIST;
    }
}

From source file:com.haulmont.cuba.gui.data.impl.EmbeddedDatasourceImpl.java

@Override
public Collection<T> getItemsToCreate() {
    return Collections.EMPTY_LIST;
}

From source file:io.qdb.server.controller.OutputController.java

@SuppressWarnings("unchecked")
@Override//from   w  w w .j  av  a 2s.c  o m
protected void list(Call call, int offset, int limit) throws IOException {
    List<OutputDTO> ans = new ArrayList<OutputDTO>();
    Queue q = call.getQueue();
    Map<String, String> outputs = q.getOutputs();
    if (outputs != null) {
        for (Map.Entry<String, String> e : outputs.entrySet()) {
            Output o = repo.findOutput(e.getValue());
            if (o != null)
                ans.add(createOutputDTO(call, e.getKey(), o, q));
        }
        Collections.sort(ans);
        int last = Math.min(offset + limit, ans.size());
        if (offset > 0 || last < ans.size()) {
            if (offset >= ans.size())
                ans = Collections.EMPTY_LIST;
            else
                ans = ans.subList(offset, last);
        }
    }
    call.setJson(ans);
}

From source file:architecture.ee.web.community.announce.impl.DefaultAnnounceManager.java

public List<Announce> getAnnounces(int objectType, long objectId, Date startDate, Date endDate) {
    List<Long> announceIds = announceDao.getAnnounceIds(objectType, objectId);
    if (announceIds.size() == 0)
        return Collections.EMPTY_LIST;
    if (startDate == null)
        startDate = new Date(0x8000000000000000L);
    if (endDate == null)
        endDate = new Date(0x7fffffffffffffffL);

    List<Announce> results = filterAnnounces(startDate, endDate, announceIds);
    return results;
}

From source file:com.streamsets.pipeline.stage.processor.xmlflattener.TestXMLFlatteningProcessor.java

@Test
public void testSingleRecordAttrsNS() throws Exception {
    String xml = getXML("");
    Record expected = RecordCreator.create();
    expected.set(Field.create(createExpectedRecord("", "", "", "_", ".", "", true, true)));
    doTest(xml, "contact", "_", ".", "", ImmutableList.of(expected), Collections.EMPTY_LIST,
            OnRecordError.DISCARD, false, false, false, false);
}