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.eel.kitchen.jsonschema.validator.ArrayValidator.java

ArrayValidator(final JsonNode schema) {
    JsonNode node;/* ww  w.j av a2 s .  com*/

    node = schema.path("items");

    if (!node.isArray()) {
        // Either it is missing or it is an object
        additionalItems = node.isObject() ? node : JacksonUtils.emptySchema();
        items = Collections.emptyList();
        return;
    }

    items = ImmutableList.copyOf(node);

    node = schema.path("additionalItems");

    additionalItems = node.isObject() ? node : JacksonUtils.emptySchema();
}

From source file:org.juiser.spring.security.authentication.JwsToUserDetailsConverter.java

@Override
public UserDetails apply(String headerValue) {

    Claims claims = claimsExtractor.apply(headerValue);

    User user = claimsUserFactory.apply(claims);

    Collection<? extends GrantedAuthority> authorities = Collections.emptyList();
    if (authoritiesResolver != null) {
        authorities = authoritiesResolver.apply(claims);
    }/*from w ww.ja  v a 2s. c  o m*/

    return new ForwardedUserDetails(user, authorities);
}

From source file:fr.xebia.springframework.security.core.providers.ExtendedDaoAuthenticationProviderTest.java

private void testAdditionalchecks(String allowedRemoteAddresses, String remoteAddr) {
    ExtendedDaoAuthenticationProvider daoAuthenticationProvider = new ExtendedDaoAuthenticationProvider();

    Collection<GrantedAuthority> grantedAuthorities = Collections.emptyList();

    ExtendedUser extendedUser = new ExtendedUser("test-user", "test-password", true, true, true, true,
            grantedAuthorities);/*from  w  w  w .ja  v a 2  s . co  m*/

    extendedUser.setAllowedRemoteAddresses(allowedRemoteAddresses);

    UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken("test-user",
            "test-password");
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setRemoteAddr(remoteAddr);
    authentication.setDetails(new WebAuthenticationDetails(request));

    daoAuthenticationProvider.additionalAuthenticationChecks(extendedUser, authentication);
}

From source file:org.openwms.core.uaa.RoleServiceImpl.java

/**
 * {@inheritDoc}/*from w w w.j  a  va2 s. com*/
 * <p>
 * Return type ArrayList
 */
@Override
public Collection<Role> findAll() {
    List<Role> roles = repository.findAll();
    return roles == null ? Collections.emptyList() : roles;
}

From source file:com.heliosdecompiler.helios.tasks.DecompileAndSaveTask.java

public DecompileAndSaveTask(List<Pair<String, String>> data) {
    this.data = data == null ? Collections.emptyList() : data;
}

From source file:com.adobe.acs.commons.util.CookieUtil.java

/**
 * Gets Cookies from the Request whose names match the provides Regex
 *
 * @param request Request to get the Cookie from
 * @param regex   Regex to match against Cookie names
 * @return Cookies which match the Regex
 *///w ww  .  j a  v  a2  s.  c  o  m
public static List<Cookie> getCookies(final HttpServletRequest request, final String regex) {
    final ArrayList<Cookie> foundCookies = new ArrayList<Cookie>();
    if (StringUtils.isBlank(regex)) {
        return foundCookies;
    }

    final Cookie[] cookies = request.getCookies();
    if (cookies == null) {
        return Collections.emptyList();
    }

    final Pattern p = Pattern.compile(regex);
    for (final Cookie cookie : cookies) {
        final Matcher m = p.matcher(cookie.getName());
        if (m.matches()) {
            foundCookies.add(cookie);
        }
    }

    return foundCookies;
}

From source file:com.asakusafw.runtime.flow.ResultOutput.java

/**
 * Creates a new instance.//from ww w  .j  av  a2 s . c om
 * @param context the current context
 * @param writer the record writer for writing data model objects
 * @throws IOException if failed to initialize the output
 * @throws InterruptedException if interrupted while initializing the output
 * @throws IllegalArgumentException if some parameters are {@code null}
 */
@SuppressWarnings({ "rawtypes" })
public ResultOutput(TaskAttemptContext context, RecordWriter writer) throws IOException, InterruptedException {
    this(context, writer, Collections.emptyList());
}

From source file:gov.nih.nci.caintegrator.web.action.query.form.AbstractCriterionRow.java

/**
 * Returns the parameters for this row./*from   ww w  .  j av a 2s  .  c  o m*/
 *
 * @return the parameters.
 */
public List<AbstractCriterionParameter> getParameters() {
    if (getCriterionWrapper() == null) {
        return Collections.emptyList();
    } else {
        return getCriterionWrapper().getParameters();
    }
}

From source file:org.dhatim.dropwizard.jwt.cookie.authentication.DefaultJwtCookiePrincipal.java

/**
 * Build a new instance of DefaultJwtCookiePrincipal with the given name
 *
 * @param name the name/*from  w  ww.  j a v a  2s. c o m*/
 */
public DefaultJwtCookiePrincipal(String name) {
    this(name, false, Collections.emptyList(), null);
}

From source file:tools.xor.service.HibernateDAOTemplate.java

@SuppressWarnings("unchecked")
@Override/*from  w ww  .j ava 2s .c o m*/
public List<T> findByIds(Collection ids) {
    if (ids.isEmpty()) {
        return Collections.emptyList();
    }
    Criteria crit = getSession().createCriteria(persistentClass);
    crit.add(Restrictions.in("id", ids));
    return crit.list();
}