Example usage for java.util Collections EMPTY_LIST

List of usage examples for java.util Collections EMPTY_LIST

Introduction

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

Prototype

List EMPTY_LIST

To view the source code for java.util Collections EMPTY_LIST.

Click Source Link

Document

The empty list (immutable).

Usage

From source file:com.github.cherimojava.orchidae.security.MongoUserDetailService.java

/**
 * retrieves the user information or null if no such user is found
 * //w  w  w  . ja v  a 2 s .  c o m
 * @param username
 * @return
 * @throws UsernameNotFoundException
 */
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    User user = userUtil.getUser(username);
    if (user == null) {
        return null;
    }
    return new org.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(),
            Collections.EMPTY_LIST);
}

From source file:com.appdynamicspilot.persistence.CartPersistence.java

/**
 * Gets all the items from cart//from  w  w w  .ja  va2s.  c om
 *
 * @param cartId
 * @return List of items
 */
public List<Item> getAllCartItems(Long cartId) {
    Cart cart = getEntityManager().find(Cart.class, cartId);
    if (cart == null) {
        return Collections.EMPTY_LIST;
    }
    return cart.getItems();
}

From source file:org.osmsurround.ra.search.SearchRelationController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView get(@Valid SearchModel searchModel, Errors errors) {
    ModelAndView modelAndView = new ModelAndView("searchResult");
    modelAndView.addObject("tagInfos", tagInfoService.getTagInfos());

    if (errors.hasErrors()) {
        modelAndView.addObject("result", new SearchResult(Collections.EMPTY_LIST));
    } else {/*from ww w.j  ava  2 s .  c o m*/
        List<Relation> list = relationSearch.search(searchModel);
        modelAndView.addObject("result", new SearchResult(list));
    }

    return modelAndView;
}

From source file:de.hybris.platform.servicelayer.media.impl.DefaultMediaDaoIntegrationTest.java

@Test
public void testFindFolderByCode() {
    assertEquals(Arrays.asList(folder), mediaDao.findMediaFolderByQualifier(folder.getQualifier()));
    assertEquals(Collections.EMPTY_LIST,
            mediaDao.findMediaFolderByQualifier("illegal_" + folder.getQualifier()));
}

From source file:org.shept.persistence.provider.hibernate.HibernateExampleListProviderImpl.java

@Override
public List<?> loadListNext() {
    List<?> l = Collections.EMPTY_LIST;
    if (!eol) {//  www  . ja  v a  2  s .  co m
        l = getHibernateTemplate().findByExample(example, sortDef, loaded, loadSize);
        incrementLoadSizeAfterFetch(l.size());
    }
    return l;
}

From source file:hr.fer.zemris.vhdllab.service.workspace.ProjectMetadataTest.java

@SuppressWarnings("unchecked")
@Before//w ww .j a va2  s .c  o m
public void initObject() {
    Project project = new Project("userId", "name");
    hierarchy = new Hierarchy(project, Collections.EMPTY_LIST);

    files = new HashSet<File>(2);
    File file = new File("file1", null, "data");
    file.setProject(project);
    files.add(file);
    file = new File("file2", null, "data2");
    file.setProject(project);
    files.add(file);

    metadata = new ProjectMetadata(hierarchy, files);
}

From source file:nl.surfnet.coin.ldap.LdapClientImplTest.java

/**
 * Test method for//from  w ww .j a v a 2s  . com
 * {@link nl.surfnet.coin.ldap.LdapClientImpl#findPerson(java.lang.String)}.
 * 
 * @throws InvocationTargetException
 * @throws IllegalAccessException
 */
@Test
public void testFindPerson() throws IllegalAccessException, InvocationTargetException {
    LdapOperations ldapOperations = Mockito.mock(LdapOperations.class);
    LdapClientImpl ldapClient = new LdapClientImpl();
    ldapClient.setEngineBlock(new EngineBlockImpl());
    ldapClient.setLdapOperations(ldapOperations);

    Mockito.when(
            ldapOperations.search(Mockito.anyString(), Mockito.anyString(), (AttributesMapper) Mockito.any()))
            .thenReturn(Collections.EMPTY_LIST);

    Person findPerson = ldapClient.findPerson("urn:collab:person:myuniversity:john.doe");
    assertNull(findPerson);
}

From source file:it.geosolutions.geostore.core.security.ldap.CustomAttributesLdapUserDetailsMapperTest.java

@Before
public void setUp() {
    attributeMappings = new HashMap<String, String>();
    authorities = Collections.EMPTY_LIST;
    mapper = new CustomAttributesLdapUserDetailsMapper(attributeMappings);
    ctx = new MockDirContextOperations();
}

From source file:uk.ac.ebi.intact.editor.controller.admin.HqlRunnerController.java

public List<String> getColumns() {
    return columns != null ? columns : Collections.EMPTY_LIST;
}

From source file:ml.shifu.shifu.util.ClassUtils.java

@SuppressWarnings("unchecked")
public static List<Method> getAllMethods(Class<?> clazz) {
    if (clazz == null) {
        return Collections.EMPTY_LIST;
    }//w  ww  . ja  v  a 2  s.c om

    if (clazz.equals(Object.class)) {
        return Collections.EMPTY_LIST;
    }

    List<Method> result = new ArrayList<Method>();
    for (Method method : clazz.getDeclaredMethods()) {
        result.add(method);
    }
    Class<?> tmpClazz = clazz.getSuperclass();
    while (!Object.class.equals(tmpClazz)) {
        result.addAll(getAllMethods(tmpClazz));
        tmpClazz = tmpClazz.getSuperclass();
    }

    return result;
}