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:cz.muni.fi.mir.db.dao.impl.AnnotationValueDAOImpl.java

@Override
public List<AnnotationValue> getAllForFormulas() {
    List<AnnotationValue> result = Collections.emptyList();
    try {/*www  . j  a  v a2 s.  com*/
        result = entityManager
                .createQuery(
                        "SELECT av FROM annotationValue av WHERE av.type = :type ORDER BY av.priority DESC",
                        AnnotationValue.class)
                .setParameter("type", AnnotationValue.Type.FORMULA).setFirstResult(0).setMaxResults(10)
                .getResultList();
    } catch (NoResultException nre) {
        logger.debug(nre);
    }

    return result;
}

From source file:Main.java

public static List<Element> elements(Element element, String namespace, String localName) {
    if (element == null || !element.hasChildNodes()) {
        return Collections.emptyList();
    }//from   w  w  w.j a v a  2  s.  c o  m

    List<Element> elements = new ArrayList<Element>();
    for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
        String childNamespace = element.getNamespaceURI();
        if (child.getNodeType() == Node.ELEMENT_NODE
                && (namespace != null ? namespace.equals(childNamespace) : childNamespace == null)
                && localName.equals(element.getLocalName())) {
            elements.add((Element) child);
        }
    }
    return elements;
}

From source file:io.pivotal.strepsirrhini.chaosloris.web.ChaosResourceAssemblerTest.java

@Test
public void toResource() {
    Application application = new Application(UUID.randomUUID());
    application.setId(-1L);// w w w  .  j  a va2  s.c o  m

    Schedule schedule = new Schedule("0 0 * * * *", "hourly");
    schedule.setId(-2L);

    Chaos chaos = new Chaos(application, 0.2, schedule);
    chaos.setId(-3L);

    Event event = new Event(chaos, Instant.EPOCH, Collections.emptyList(), Integer.MIN_VALUE);
    event.setId(-4L);

    when(this.eventRepository.findByChaos(chaos)).thenReturn(Collections.singletonList(event));

    ChaosResourceAssembler.ChaosResource resource = this.resourceAssembler.toResource(chaos);

    assertThat(resource.getContent()).isSameAs(chaos);
    assertThat(resource.getLinks()).hasSize(4);
    assertThat(resource.getLink("application")).isNotNull();
    assertThat(resource.getLink("event")).isNotNull();
    assertThat(resource.getLink("schedule")).isNotNull();
}

From source file:com.splunk.shuttl.archiver.filesystem.hadoop.HadoopArchiveFileSystem.java

@Override
public List<String> listPath(String pathToBeListed) throws IOException {
    Path hadoopPath = new Path(pathToBeListed);
    FileStatus[] fileStatusOfPath = hadoopFileSystem.listStatus(hadoopPath);
    if (fileStatusOfPath != null)
        return new FileStatusBackedList(fileStatusOfPath);
    else//from  ww  w  .j a v  a2  s .  c  o m
        return Collections.emptyList();
}

From source file:com.example.app.support.ui.vtcrop.VTCropCSSLibrary.java

/**
 * Create a new instance with no dependencies
 *
 * @param classPath the resource classpath
 */
VTCropCSSLibrary(String classPath) {
    _classPath = classPath;
    _dependencies = Collections.emptyList();
}

From source file:com.kuprowski.redis.security.core.session.RedisSessionRegistry.java

@Override
public List<SessionInformation> getAllSessions(Object principal, boolean includeExpiredSessions) {
    final Set<String> sessionsUsedByPrincipal = getSessionsUsedByPrincipal(principal);

    if (sessionsUsedByPrincipal == null) {
        return Collections.emptyList();
    }//from  www . ja  v a2 s  .  co  m

    List<SessionInformation> list = new ArrayList<SessionInformation>(sessionsUsedByPrincipal.size());

    for (String sessionId : sessionsUsedByPrincipal) {
        SessionInformation sessionInformation = getSessionInformation(sessionId);

        if (sessionInformation == null) {
            continue;
        }

        if (includeExpiredSessions || !sessionInformation.isExpired()) {
            list.add(sessionInformation);
        }
    }

    return list;
}

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

public List<ExternalPage> getPublishedPages(int offset, int number) {
    List<ExternalPage> list = Collections.emptyList();
    try {// w  w  w  .  ja v  a  2s  .co m
        list = genericDao.getByNamedQuery("externalPage_all_published", null, offset, number);
    } catch (DataAccessException dae) {
        log.info("Unable to get pages", dae);
    }
    return list;
}

From source file:org.labkey.nashorn.NashornModule.java

@NotNull
@Override
public Collection<String> getSummary(Container c) {
    return Collections.emptyList();
}

From source file:com.codepine.api.testrail.internal.ListToCsvSerializerTest.java

@Test
public void W_empty_T_empty() throws IOException {
    // WHEN//from w ww.j  a  v  a  2 s  .  c o  m
    listToCsvSerializer.serialize(Collections.emptyList(), jsonGenerator, null);

    // THEN
    verify(jsonGenerator).writeString("");
}