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:io.syndesis.inspector.JsonSchemaInspector.java

@Override
public List<String> getPaths(final String kind, final String type, final String specification,
        final Optional<byte[]> exemplar) {
    final ObjectSchema schema;
    try {/*from  w  w w.j  a  v  a  2  s  .  co m*/
        schema = MAPPER.readerFor(ObjectSchema.class).readValue(specification);
    } catch (final IOException e) {
        LOG.warn(
                "Unable to parse the given JSON schema, increase log level to DEBUG to see the schema being parsed");
        LOG.debug(specification);

        return Collections.emptyList();
    }

    final Map<String, JsonSchema> properties = schema.getProperties();

    final List<String> paths = new ArrayList<>();
    fetchPaths(null, paths, properties);

    return paths;
}

From source file:com.xavin.config.security.JWTLoginFilter.java

/**
 * @Override protected boolean requiresAuthentication(HttpServletRequest
 * request, HttpServletResponse response) {
 *
 * }/*from   www  . j  a  v a2 s.  com*/
 */
@Override
public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res)
        throws AuthenticationException, IOException, ServletException {
    String data = IOUtils.toString(req.getInputStream(), StandardCharsets.UTF_8);
    AccountCredentials creds = new ObjectMapper().readValue(data, AccountCredentials.class);
    return getAuthenticationManager().authenticate(new UsernamePasswordAuthenticationToken(creds.getUsername(),
            creds.getPassword(), Collections.emptyList()));
}

From source file:com.xixicm.de.presentation.view.adapter.SentenceDetailPageAdapter.java

public SentenceDetailPageAdapter(Context context, List<? extends Sentence> sentences,
        SentencesAdapter.FavoriteClickListener favoriteClickListener) {
    mContext = context;/*from   w w  w.j  av a 2 s.c  o  m*/
    mInflater = LayoutInflater.from(mContext);
    mFavoriteClickListener = favoriteClickListener;
    mSentences = sentences;
    if (sentences == null) {
        mSentences = Collections.emptyList();
    }
}

From source file:com.kagilum.plugins.icescrum.IceScrumProjectProperty.java

@Override
public Collection<? extends Action> getJobActions(AbstractProject<?, ?> job) {
    if (settings != null) {
        return Collections.singleton(new IceScrumLinkAction(this));
    }/* www. j a  v a2 s .  co  m*/
    return Collections.emptyList();
}

From source file:org.onebusaway.nyc.vehicle_tracking.impl.inference.JourneyPhaseSummaryLibrary.java

public List<JourneyPhaseSummary> extendSummaries(VehicleState parentState, BlockState blockState,
        JourneyState journeyState, Observation observation) {

    List<JourneyPhaseSummary> parentSummaries = Collections.emptyList();

    if (parentState != null)
        parentSummaries = parentState.getJourneySummaries();

    List<JourneyPhaseSummary> summaries = new ArrayList<JourneyPhaseSummary>(parentSummaries);

    if (summaries.isEmpty()) {
        JourneyPhaseSummary summary = createJourneySummary(blockState, journeyState, observation);
        summaries.add(summary);/* w ww . ja  v  a 2  s  .c  om*/
    } else {
        JourneyPhaseSummary previous = summaries.get(summaries.size() - 1);
        JourneyPhaseSummary merged = createMergedJourneySummary(blockState, journeyState, observation,
                previous);
        if (merged != null) {
            summaries.set(summaries.size() - 1, merged);
        } else {
            JourneyPhaseSummary summary = createJourneySummary(blockState, journeyState, observation);
            summaries.add(summary);
        }
    }

    return summaries;
}

From source file:com.temenos.useragent.generic.mediatype.JsonPayloadHandler.java

@Override
public List<Link> links() {
    if (!isCollection()) {
        return extractLinks(getJsonResponse(JSONObject.class));
    }//from   w w w  . ja va2 s  .co  m
    return Collections.emptyList();
}

From source file:org.eel.kitchen.jsonschema.keyword.AbstractTypeKeywordValidator.java

protected AbstractTypeKeywordValidator(final String keyword, final JsonNode schema) {
    super(keyword, NodeType.values());
    final JsonNode node = schema.get(keyword);

    if (node.isTextual()) {
        addSimpleType(node.textValue());
        schemas = Collections.emptyList();
        return;/*from   ww  w. j a va 2  s.  co m*/
    }

    final ImmutableList.Builder<JsonNode> builder = new ImmutableList.Builder<JsonNode>();

    for (final JsonNode element : node)
        if (element.isTextual())
            addSimpleType(element.textValue());
        else
            builder.add(element);

    schemas = builder.build();
}

From source file:com.espirit.moddev.cli.exception.ExceptionHandler.java

/**
 * Instantiates a new instance./*from w  w w  .j  a  v a2 s.c  o m*/
 * @param app the commandline app
 * @param appName
 * @param args the commandline arguments
 */
public ExceptionHandler(final Cli app, final String appName, final String[] args) {
    this.app = app;
    this.appName = appName;
    if (args != null) {
        arguments = Arrays.asList(args);
    } else {
        arguments = Collections.emptyList();
    }
}

From source file:ratpack.spring.groovy.internal.RatpackScriptActionFactory.java

public List<Action<Chain>> getHandlerActions() {

    if (source == null) {
        return Collections.emptyList();
    }//from  ww  w .  j a v a  2 s .com

    final RatpackImpl ratpack = new RatpackImpl();
    ClosureUtil.configureDelegateFirst(ratpack, source.getRatpack());

    return Collections.<Action<Chain>>singletonList(chain -> ClosureUtil
            .configureDelegateFirst(new DefaultGroovyChain(chain), ratpack.handlersConfigurer));

}

From source file:com.jeanchampemont.notedown.security.NoteDownUserDetailsService.java

@Transactional(readOnly = true)
@Override//  w w w.ja v  a 2  s .c om
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
    User user = userRepository.findByEmailIgnoreCase(s);
    if (user == null) {
        throw new UsernameNotFoundException("not found");
    }
    return new org.springframework.security.core.userdetails.User(user.getEmail(), user.getPassword(), true,
            true, true, true, Collections.emptyList());
}