Example usage for javax.json JsonArray containsAll

List of usage examples for javax.json JsonArray containsAll

Introduction

In this page you can find the example usage for javax.json JsonArray containsAll.

Prototype

boolean containsAll(Collection<?> c);

Source Link

Document

Returns true if this list contains all of the elements of the specified collection.

Usage

From source file:joachimeichborn.geotag.geocode.GoogleGeocoder.java

private String getMatchingContent(final String aAttribute, final JsonArray aResults,
        final LocationType... aLocationTypes) {
    for (final LocationType locationType : aLocationTypes) {
        for (final JsonObject component : aResults.getValuesAs(JsonObject.class)) {
            final JsonArray types = component.getJsonArray(TYPES_KEY);
            if (types.containsAll(locationType.getIdentifiers()) && component.containsKey(aAttribute)) {
                return component.getString(aAttribute);
            }//from w  w w  .  j ava 2 s . c o m
        }
    }

    return null;
}