Example usage for java.util Collections emptyList

List of usage examples for java.util Collections emptyList

Introduction

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

Prototype

@SuppressWarnings("unchecked")
public static final <T> List<T> emptyList() 

Source Link

Document

Returns an empty list (immutable).

Usage

From source file:no.dusken.aranea.service.ArticleServiceImpl.java

public List<Article> getArticlesByIssue(Issue issue) {
    List<Article> list = Collections.emptyList();
    try {//from ww w .  ja v  a2 s . c  o  m
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("issue", issue);
        list = genericDao.getByNamedQuery("article_byissue", map);
    } catch (DataAccessException dae) {
        log.info("Unable to get Articles", dae);
    }
    return list;
}

From source file:org.smf4j.spring.FileEnablerBean.java

public void setPaths(List<String> paths) {
    if (paths == null) {
        paths = Collections.emptyList();
    }
    this.paths = paths;
}

From source file:com.hortonworks.streamline.streams.cluster.register.impl.HBaseServiceRegistrar.java

@Override
protected List<Component> createComponents(Config config, Map<String, String> flattenConfigMap) {
    // no component to register
    return Collections.emptyList();
}

From source file:no.dusken.aranea.service.ExternalPageServiceImpl.java

public List<ExternalPage> getExternalPagesBySite(String site) {
    List<ExternalPage> list = Collections.emptyList();
    try {//from   ww  w  .java 2s .  c  o  m
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("site", site);
        list = genericDao.getByNamedQuery("externalPage_by_site", map);
    } catch (DataAccessException dae) {
        log.info("Unable to get externalPages", dae);
    }
    return list;
}

From source file:au.com.borner.salesforce.client.rest.domain.AbstractJSONObject.java

public List<String> toStringList(JSONArray array) {
    try {//  ww w  . j a v  a 2 s  .c o m
        List<String> result = new ArrayList<String>(array.length());
        for (int i = 0; i < array.length(); i++) {
            result.add(array.getString(i));
        }
        return result;
    } catch (JSONException e) {
        return Collections.emptyList();
    }
}

From source file:com.hp.autonomy.frontend.find.hod.typeahead.HodTypeAheadService.java

@Override
@Cacheable(cacheNames = FindCacheNames.TYPE_AHEAD, cacheResolver = HodConfiguration.SIMPLE_CACHE_RESOLVER_NAME)
public List<String> getSuggestions(final String text) throws GetSuggestionsFailedException {
    if (StringUtils.isBlank(text)) {
        return Collections.emptyList();
    } else {/*from  w  w  w . j  a  va  2  s  . c  om*/
        try {
            return autocompleteService.getSuggestions(text);
        } catch (final HodErrorException e) {
            throw new GetSuggestionsFailedException(e);
        }
    }
}

From source file:com.temenos.useragent.generic.mediatype.PlainTextEntityHandler.java

@Override
public List<Link> getLinks() {
    return Collections.emptyList();
}

From source file:com.cpjit.swagger4j.util.ReflectUtils.java

/**
 * ???//from  www  .  j a va  2  s.co  m
 * 
 * @param packNames
 *            ??
 * @return ??null
 *       0
 *       <li>?packNames0</li>
 *       <li>?</li>
 * 
 * @throws FileNotFoundException ?
 * @throws IllegalArgumentException ??? 
 * @throws ClassNotFoundException ?
 * 
 * @since 1.0.0
 */
public static List<Class<?>> scanClazzs(List<String> packNames)
        throws FileNotFoundException, IllegalArgumentException, ClassNotFoundException {
    if (packNames.size() < 1) { // ??
        return Collections.emptyList();
    }

    Set<Class<?>> clazzs = new HashSet<Class<?>>();
    for (String packName : packNames) {
        List<String> clazzNames = scanClazzName(packName);
        for (String clazzName : clazzNames) { // ?
            Class<?> clazz = Class.forName(clazzName);
            clazzs.add(clazz);
        }
    }
    if (clazzs.size() < 1) { // ?
        return Collections.emptyList();
    }
    return new ArrayList<Class<?>>(clazzs);
}

From source file:Main.java

/**
 * Evaluates the XPath expression in the specified context and returns the found items as a List.
 *
 * @param node       the XML document to evaluate
 * @param expression the compiled XPath expression
 * @return the list of elements found/*  w w w.  j a  v  a2 s . c o  m*/
 */
public static List<String> getListValue(Node node, XPathExpression expression) {
    try {
        NodeList nodeList = (NodeList) expression.evaluate(node, XPathConstants.NODESET);
        List<String> list = new ArrayList<String>(nodeList.getLength());
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node item = nodeList.item(i);
            list.add(item.getFirstChild().getNodeValue());
        }
        return list;
    } catch (XPathExpressionException e) {
        // Try to evaluate in string context:
        String value = getStringValue(node, expression);
        if (value != null) {
            List<String> list = new ArrayList<String>(1);
            list.add(value);
            return list;
        }
        return Collections.emptyList();
    }
}

From source file:com.example.session.domain.service.goods.GoodsService.java

/**
 * ??????/*from  w  w  w.ja va  2 s  .c o  m*/
 * 
 * @param categoryId
 * @param pageable
 * @return
 */
public Page<Goods> findByCategoryId(Integer categoryId, Pageable pageable) {

    long total = goodsRepository.countByCategoryId(categoryId);

    List<Goods> goodsList = Collections.emptyList();
    if (total > 0) {
        RowBounds rowBounds = new RowBounds((int) pageable.getOffset(), pageable.getPageSize());
        goodsList = goodsRepository.findPageByCategoryId(categoryId, rowBounds);
    }

    return new PageImpl<Goods>(goodsList, pageable, total);
}