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:org.pdfsam.news.DefaultNewsService.java

public List<NewsData> getLatestNews() {
    try {//from w w  w.  j av a  2 s .c o m
        return JSON.std.with(Feature.READ_ONLY, true).listOfFrom(NewsData.class,
                new URL(pdfsam.property(ConfigurableProperty.NEWS_URL)));
    } catch (IOException e) {
        LOG.warn(DefaultI18nContext.getInstance().i18n("Unable to retrieve latest news"), e);
    }
    return Collections.emptyList();
}

From source file:com.xtructure.xutil.valid.strategy.UTestTestValidationStrategy.java

@Test(expectedExceptions = { IllegalArgumentException.class })
public void constructorWithNoPredicatesThrowsException() {
    List<Condition> empty = Collections.emptyList();
    new TestValidationStrategy<Object>(empty);
}

From source file:net.sourceforge.fenixedu.domain.candidacy.workflow.form.ResidenceApplianceInquiryForm.java

@Override
public List<LabelFormatter> validate() {
    if (!StringUtils.isEmpty(this.notesAboutApplianceForResidence) && !isToApplyForResidence) {
        return Collections.singletonList(new LabelFormatter().appendLabel(
                "error.candidacy.workflow.ResidenceApplianceInquiryForm.notes.can.only.be.filled.in.case.of.appliance",
                "application"));
    }/*from w w w. j av  a  2  s. c o  m*/

    return Collections.emptyList();
}

From source file:org.openlmis.fulfillment.service.request.RequestParameters.java

/**
 * Set parameter (key argument) with the value only if the value is not null.
 *//*w w  w  .ja v  a  2 s  .c  o  m*/
public RequestParameters set(String key, Collection<?> valueCollection) {
    Optional.ofNullable(valueCollection).orElse(Collections.emptyList()).forEach(elem -> set(key, elem));

    return this;
}

From source file:com.yahoo.elide.core.ResourceLineage.java

/**
 * Gets record./*from ww w .jav a2 s.c  o  m*/
 *
 * @param name the name
 * @return the record
 */
public List<PersistentResource> getRecord(String name) {
    List<PersistentResource> list = resourceMap.get(name);
    return list == null ? Collections.emptyList() : list;
}

From source file:ddf.catalog.impl.operations.OperationsCatalogStoreSupport.java

List<CatalogStore> getCatalogStoresForRequest(Request request, Set<ProcessingDetails> exceptions) {
    if (!isCatalogStoreRequest(request)) {
        return Collections.emptyList();
    }/*from   w  ww.ja va 2s  .  c  o m*/

    List<CatalogStore> results = new ArrayList<>(request.getStoreIds().size());
    for (String destination : request.getStoreIds()) {
        final List<CatalogStore> sources = frameworkProperties.getCatalogStores().stream()
                .filter(e -> e.getId().equals(destination)).collect(Collectors.toList());

        if (sources.isEmpty() && (sourceOperations.getCatalog() == null
                || !destination.equals(sourceOperations.getCatalog().getId()))) {
            exceptions.add(new ProcessingDetailsImpl(destination, null, "CatalogStore does not exist"));
        } else if (!sources.isEmpty()) {
            if (sources.size() != 1) {
                LOGGER.debug("Multiple CatalogStores for id: {}", destination);
            }
            results.add(sources.get(0));
        }
    }
    return results;
}

From source file:com.xtructure.xutil.valid.strategy.UTestStateValidationStrategy.java

@Test(expectedExceptions = { IllegalArgumentException.class })
public void constructorWithNoPredicatesThrowsException() {
    List<Condition> empty = Collections.emptyList();
    new StateValidationStrategy<Object>(empty);
}

From source file:com.liyablieva.jaxws.dao.EmployeeDAOImpl.java

@SuppressWarnings("unchecked")
@Override/*from  w w  w  .  j a  v a 2s.  c  om*/
@Transactional(value = "transactionManager")
public List<Employee> getEmployees(String department) {

    System.out.println("In get employees DAO");
    int departmentId = getDepartmentId(department);
    System.out.println("Department = " + department + ", departmentId = " + departmentId);

    List<Employee> employees = Collections.emptyList();

    String sql = "SELECT * FROM employee WHERE department_id = :department_id";
    SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);
    query.addEntity(Employee.class);
    query.setParameter("department_id", departmentId);
    employees = query.list();

    return employees;
}

From source file:io.relution.jenkins.scmsqs.model.CodeCommitMessageParser.java

@Override
public List<Event> parseMessage(final Message message) {
    try {//from w w  w. java 2 s  . c  o m
        final MessageBody body = this.gson.fromJson(message.getBody(), MessageBody.class);
        Log.info("Got message with subject: %s", body.getSubject());
        final String json = body.getMessage();

        if (StringUtils.isEmpty(json)) {
            Log.warning("Message contains no text");
            return Collections.emptyList();
        }

        if (!json.startsWith("{") || !json.endsWith("}")) {
            Log.warning("Message text is no JSON");
            return Collections.emptyList();
        }

        return this.parseRecords(json);
    } catch (final com.google.gson.JsonSyntaxException e) {
        Log.warning("JSON syntax exception, cannot parse message: %s", e);
    }
    return Collections.emptyList();
}

From source file:io.wcm.caravan.pipeline.extensions.hal.action.BuildResourceTest.java

@Before
public void setup() {

    JsonPipelineOutput input = new JsonPipelineOutputImpl(payload, Collections.emptyList());
    JsonPipelineOutput output = action.execute(input, context).toBlocking().single();
    hal = new HalResource(output.getPayload());

}