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:converter.TagsConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException {
    if (value == null) {
        FacesMessage message = new FacesMessage(i18n.getString("page.results.errors.tags"));
        throw new ConverterException(message);
    }/*from   w  w  w. ja v  a  2s  .c o m*/

    List<String> topicsSelected;
    if (value.length() > 0) {
        topicsSelected = new ArrayList();
        String[] terms = value.trim().split(",");
        for (int i = 0, len = terms.length; i < len; i++) {
            topicsSelected.add(terms[i]);
        }
    } else {
        topicsSelected = Collections.emptyList();
    }
    return topicsSelected;
}

From source file:com.greenbird.mule.http.log.converter.UserNameConverterTest.java

@Test
public void doConvert_springPrincipalAvailable_userNameFound() throws Exception {
    Collection<? extends GrantedAuthority> emptyList = Collections.emptyList();
    String logOutput = logWithSession(UserNameConverter.CONVERSION_CHARACTER,
            securedSession(new User(TEST_USER, "pw", emptyList)));
    assertThat(logOutput, is(TEST_USER));
}

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

public List<Page> getSectionPagePublished(int numberOfPages, Section section) {
    List<Page> pages = Collections.emptyList();
    try {//  w w w. j  a v  a 2 s. c  o m
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("time", new GregorianCalendar());
        map.put("section", section);
        pages = genericDao.getByNamedQuery("page_bysection_published", map, 0, numberOfPages);
    } catch (DataAccessException e) {
        log.error("Unable to get pages by section", e);
    }
    return pages;
}

From source file:eu.over9000.cathode.data.parameters.SearchChannelOptions.java

@Override
public List<NameValuePair> buildParamPairs() {
    if (query == null) {
        return Collections.emptyList();
    }//from www  .  ja  va2  s  .  c o m
    return Collections.singletonList(new BasicNameValuePair("query", query));
}

From source file:ca.uhn.fhir.rest.method.BaseJavaPrimitiveBinder.java

@SuppressWarnings("unchecked")
@Override//from  w  ww .j av  a 2 s.  c o  m
public List<IQueryParameterOr<?>> encode(FhirContext theContext, T theString) throws InternalErrorException {
    String retVal = doEncode(theString);
    if (isBlank(retVal)) {
        return Collections.emptyList();
    }
    List<?> retValList = Collections.singletonList(MethodUtil.singleton(new StringParam(retVal), null));
    return (List<IQueryParameterOr<?>>) retValList;
}

From source file:newcontroller.handler.impl.DefaultRequest.java

public DefaultRequest(HttpServletRequest request, List<HttpMessageConverter<?>> converters) {
    this.request = request;
    this.converters = (converters == null ? Collections.emptyList() : converters);
}

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

public List<BannerLocation> getBannerLocations() {
    List<BannerLocation> list = Collections.emptyList();
    try {//www .j  ava  2s.  c o m
        list = genericDao.getByNamedQuery("bannerlocations_all", null);
    } catch (DataAccessException dae) {
        log.info("Unable to get Banner locations", dae);
    }
    return list;
}

From source file:com.haulmont.cuba.core.app.cache.CacheSet.java

public CacheSet() {
    this(Collections.emptyList());
}

From source file:jease.cms.service.Informations.java

public Collection<Object> getDatabaseObjectCount() {
    //      return Database.query(Persistent.class);
    return Collections.emptyList();
}

From source file:com.haulmont.cuba.core.config.type.IntegerListTypeFactory.java

@Override
public Object build(String string) {
    List<Integer> integerList = new ArrayList<>();
    if (StringUtils.isNotEmpty(string)) {
        String[] elements = string.split(" ");
        for (String element : elements) {
            if (StringUtils.isNotEmpty(element)) {
                try {
                    Integer value = Integer.parseInt(element);
                    integerList.add(value);
                } catch (NumberFormatException e) {
                    log.debug("Invalid integer list property: " + string);
                    return Collections.emptyList();
                }//from  www. j  a v  a2 s . c  om
            }
        }
    }
    return integerList;
}