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:cn.mypandora.util.MyExcelUtil.java

/**
 * ?Excel List<Map<String K,String V>>?
 *
 * @param excelFile  Excel/*  ww  w .  j  a  v  a2s .c  om*/
 * @param fieldNames MapKeyValuesheet?
 * @param sheetName  ??
 * @return
 */
public static List<Map<String, String>> readExcelToMap(File excelFile, String fieldNames, String... sheetName) {
    List<Map<String, String>> list = Collections.EMPTY_LIST;

    try {
        Workbook workbook = WorkbookFactory.create(new FileInputStream(excelFile));
        list = execRead(workbook, fieldNames, sheetName);
    } catch (Exception e) {
        logger.error("?:" + e);
    }

    return list;
}

From source file:it.unibas.spicy.persistence.xml.model.PCDATA.java

@SuppressWarnings("unchecked")
public List<IXSDNode> getChildren() {
    return Collections.EMPTY_LIST;
}

From source file:de.hybris.platform.servicelayer.media.impl.DefaultMediaDaoIntegrationTest.java

@Test
public void testFindMediaByCode() {
    for (final MediaModel m : medias) {
        assertEquals(Arrays.asList(m), mediaDao.findMediaByCode(m.getCode()));
        assertEquals(Collections.EMPTY_LIST, mediaDao.findMediaByCode("invalid_" + m.getCode()));
    }/*from   w w w.  jav  a  2 s  .c  om*/
}

From source file:info.magnolia.cms.beans.config.Subscriber.java

/**
 * <p>/*ww w  .j  a  v a 2s  .  co  m*/
 * reads listener config from the config repository and caches its content in to the hash table
 * </p>
 */
public static void init() {
    Subscriber.cachedContent.clear();

    log.info("Config : loading Subscribers"); //$NON-NLS-1$

    Collection children = Collections.EMPTY_LIST;

    try {
        Content startPage = ContentRepository.getHierarchyManager(ContentRepository.CONFIG)
                .getContent(START_PAGE);
        Content subscriberConfig = startPage.getContent("SubscriberConfig");
        children = subscriberConfig.getChildren(ItemType.CONTENTNODE); //$NON-NLS-1$
    } catch (PathNotFoundException re) {
        log.info("No subscribers configured"); //$NON-NLS-1$
    } catch (RepositoryException re) {
        log.error("Config : Failed to load Subscribers"); //$NON-NLS-1$
        log.error(re.getMessage(), re);
    }

    if (children != null) {
        Subscriber.cacheContent(children);
    }

    log.info("Config : Subscribers loaded"); //$NON-NLS-1$

}

From source file:com.linksinnovation.elearning.repository.CourseDTORepository.java

public List<CourseDTO> findByCategory(Map<String, Long> map) {
    List<Object[]> result;
    if (null != map.get("category")) {
        String queryString = query + " WHERE category_id=:cat";
        if (null != map.get("subcategory")) {
            queryString = queryString + " AND sub_category_id=:subcat";
        }/*from  w ww  .j a  va 2s.  c  o m*/
        Query q = em.createNativeQuery(queryString);
        q.setParameter("cat", map.get("category"));
        if (null != map.get("subcategory")) {
            q.setParameter("subcat", map.get("subcategory"));
        }
        result = q.getResultList();
    } else {
        result = Collections.EMPTY_LIST;
    }
    return mapObject(result);
}

From source file:ca.qhrtech.services.implementations.BGGServiceImpl.java

@Override
public List<Game> findLinkableGames(long id) {
    Game game = gameService.findGameById(id);
    if (game == null) {
        return Collections.EMPTY_LIST;
    }//  w  w  w. j  a  va 2 s. c  o  m
    return consumeBggApi(buildUriForQuery(game), SearchQuery.class, new SearchConverter());
}

From source file:com.creactiviti.piper.core.pipeline.SimplePipeline.java

@Override
public List<Accessor> getInputs() {
    return getList(DSL.INPUTS, Accessor.class, Collections.EMPTY_LIST);
}

From source file:Main.java

private static List getSystemExports(ExportPackageDescription[] matchingExports) {
    ArrayList list = null;//from   w  ww .java 2  s .  c o m
    for (int i = 0; i < matchingExports.length; i++) {
        if (matchingExports[i].getExporter().getBundleId() != 0)
            continue;
        if (list == null)
            list = new ArrayList();
        list.add(matchingExports[i]);
    }
    return list == null ? Collections.EMPTY_LIST : list;
}

From source file:net.jcreate.home.common.BaseDAO.java

private static List getHQLParams(String pQueryString) {
    if (pQueryString == null)
        return Collections.EMPTY_LIST;
    List result = new ArrayList();
    final String PARAM_PATTERN = "\\:([\\.\\w]+)";
    Pattern pattern = Pattern.compile(PARAM_PATTERN);
    Matcher matcher = pattern.matcher(pQueryString);
    while (matcher.find()) {
        String value = matcher.group();
        result.add(value.substring(1));/*from  w w w. jav a2 s  .co m*/
    }
    return result;
}

From source file:org.dozer.spring.DozerBeanMapperFactoryBeanTest.java

@Test
public void testOk() throws Exception {
    factory.setCustomConverters(Collections.EMPTY_LIST);
    factory.setCustomConvertersWithId(Collections.EMPTY_MAP);
    factory.setEventListeners(Collections.EMPTY_LIST);
    factory.setFactories(Collections.EMPTY_MAP);
    factory.setMappingFiles(new Resource[] { mockResource });
    factory.setMappingBuilders(Collections.EMPTY_LIST);

    URL url = this.getClass().getClassLoader().getResource("mappingSpring.xml");
    when(mockResource.getURL()).thenReturn(url);

    factory.afterPropertiesSet();/*from  w w w.  j av a 2 s .  com*/

    assertEquals(Mapper.class, factory.getObjectType());
    Assert.assertTrue(factory.isSingleton());

    DozerBeanMapper mapper = (DozerBeanMapper) factory.getObject();
    List<?> files = mapper.getMappingFiles();
    assertEquals(1, files.size());
    assertEquals("file:" + url.getFile(), files.iterator().next());
}