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:com.htmlhifive.resourcefw.sample.resource.person.PersonQuerySpecifications.java

/**
 * ?????.<br>/*www  . ja  v  a 2s . c  o  m*/
 * ?????????????.
 *
 * @param conditions ?
 * @return Specification?
 */
@Override
public List<Specification<Person>> doParseConditions(Map<String, List<String>> conditions) {

    return Collections.emptyList();
}

From source file:greenpages.internal.DirectoryImpl.java

/**
 * {@inheritDoc}/*from   ww w. j a va  2  s. c o m*/
 * 
 * Stub implementation will match only for term '<code>johnson</code>'.
 */
public List<Listing> search(String term) {
    if (ROD_JOHNSON.getLastName().equalsIgnoreCase(term)) {
        Listing l = ROD_JOHNSON;

        return Collections.singletonList(l);
    } else {
        return Collections.emptyList();
    }
}

From source file:com.opensymphony.xwork2.config.ConfigurationUtil.java

/**
 * Splits the string into a list using a comma as the token separator.
 * @param parent The comma separated string.
 * @return A list of tokens from the specified string.
 *//*from ww  w  .  j  av  a 2s .  co m*/
public static List<String> buildParentListFromString(String parent) {
    if (StringUtils.isEmpty(parent)) {
        return Collections.emptyList();
    }

    StringTokenizer tokenizer = new StringTokenizer(parent, ",");
    List<String> parents = new ArrayList<>();

    while (tokenizer.hasMoreTokens()) {
        String parentName = tokenizer.nextToken().trim();

        if (StringUtils.isNotEmpty(parentName)) {
            parents.add(parentName);
        }
    }

    return parents;
}

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

public List<Issue> getIssues(int year) {
    List<Issue> i = Collections.emptyList();
    try {/*ww w .j a  v  a 2 s .  c  o m*/
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("fromDate", new GregorianCalendar(year, 0, 1));
        map.put("toDate", new GregorianCalendar(year, 11, 31));
        i = genericDao.getByNamedQuery("issues_byyear", map);
    } catch (DataAccessException dae) {
        log.warn("Unable to get Issues", dae);
    }
    return i;
}

From source file:us.sodiumlabs.survey.controllers.SurveyController.java

@RequestMapping("/")
public List<Survey> getSurveys() {
    return Collections.emptyList();
}

From source file:cd.go.contrib.elasticagents.docker.utils.Util.java

public static Collection<String> splitIntoLinesAndTrimSpaces(String lines) {
    if (isBlank(lines)) {
        return Collections.emptyList();
    }//from   w  w  w  .  j av  a 2 s .  c  o  m

    return Collections2.transform(Arrays.asList(lines.split("[\r\n]+")), new Function<String, String>() {
        @Override
        public String apply(String input) {
            return input.trim();
        }
    });
}

From source file:com.gargoylesoftware.htmlunit.util.WebConnectionWrapperTest.java

/**
 * @throws Exception if the test fails/*from   w  w w.  j a  va 2 s .  c  o  m*/
 */
@Test
public void wrapper() throws Exception {
    final List<NameValuePair> emptyList = Collections.emptyList();
    final WebResponseData data = new WebResponseData(new byte[] {}, HttpStatus.SC_OK, "", emptyList);
    final WebResponse response = new WebResponseImpl(data, URL_FIRST, HttpMethod.GET, 0);
    final WebRequestSettings wrs = new WebRequestSettings(URL_FIRST);

    final WebConnection realConnection = new WebConnection() {
        public WebResponse getResponse(final WebRequestSettings settings) {
            assertSame(wrs, settings);
            return response;
        }
    };

    final WebConnectionWrapper wrapper = new WebConnectionWrapper(realConnection);
    assertSame(response, wrapper.getResponse(wrs));
}

From source file:org.sakuli.services.forwarder.icinga2.model.builder.Icinga2PerformanceDataBuilder.java

@Override
public List<String> build() {
    String performanceData = getTestSuitePerformanceData(testSuite);
    if (performanceData != null) {
        return Arrays.asList(StringUtils.split(performanceData));
    }//from  w w w. ja va  2  s  . c om
    return Collections.emptyList();
}

From source file:com.couchbase.trombi.services.SearchService.java

public List<Coworker> findCoworkersNear(String imHandle) {
    List<Coworker> lc = coworkerRepository.findAllByIm(imHandle);
    if (lc == null || lc.isEmpty()) {
        return Collections.emptyList();
    }// w w w.  j av a 2 s .c  o m
    Coworker c = lc.get(0);

    Location latest = c.getLastCheckin();
    if (latest == null) {
        latest = c.getMainLocation();
    }

    return coworkerRepository.findAllByMainLocationCoordinatesNear(latest.getCoordinates(),
            new Distance(10, Metrics.KILOMETERS));
}

From source file:com.create.validation.PropertyValidationErrorsProvider.java

List<String> getPropertyValidationErrorsByNestedPath(String nestedPath) {
    final List<String> propertyValidationErrors = propertyValidationErrorsGroupedByNestedPath
            .getOrDefault(nestedPath, Collections.emptyList());
    return Collections.unmodifiableList(propertyValidationErrors);
}