urbanairship-core/src/main/java/com/urbanairship/remotedata/RemoteData.java
public Observable<Collection<RemoteDataPayload>> payloadsForTypes(@NonNull final Collection<String> types) {
        return Observable.concat(cachedPayloads(types), payloadUpdates)
                         .map(new Function<Set<RemoteDataPayload>, Map<String, Collection<RemoteDataPayload>>>() {
                             @Override
                             public Map<String, Collection<RemoteDataPayload>> apply(Set<RemoteDataPayload> payloads) {
                                 Map<String, Collection<RemoteDataPayload>> map = new HashMap<>();
                                 for (RemoteDataPayload payload : payloads) {
                                     if (!map.containsKey(payload.getType())) {
                                         map.put(payload.getType(), new HashSet<RemoteDataPayload>());
                                     }
                                     map.get(payload.getType()).add(payload);
                                 }

                                 return map;
                             }
                         })
                         .map(new Function<Map<String, Collection<RemoteDataPayload>>, Collection<RemoteDataPayload>>() {
                             @Override
                             public Collection<RemoteDataPayload> apply(Map<String, Collection<RemoteDataPayload>> payloadMap) {
                                 Set<RemoteDataPayload> payloads = new HashSet<>();
                                 for (String type : new HashSet<>(types)) {
                                     if (payloadMap.containsKey(type)) {
                                         payloads.addAll(payloadMap.get(type));
                                     } else {
                                         payloads.add(new RemoteDataPayload(type, 0, JsonMap.newBuilder().build()));
                                     }
                                 }

                                 return payloads;
                             }
                         })
                         .distinctUntilChanged();
    }
/**
     * Produces an Observable of a List of RemoteDataPayload objects corresponding to the provided types.
     * Subscribers will be notified of any cached data upon subscription, as well as subsequent changes
     * following refresh updates, provided one of the payload's timestamps is fresh.
     *
     * @param types A collection of types.
     * @return An Observable of RemoteDataPayload.
     */
Produces an Observable of a List of RemoteDataPayload objects corresponding to the provided types.
Subscribers will be notified of any cached data upon subscription, as well as subsequent changes
following refresh updates, provided one of the payload's timestamps is fresh.

@param types A collection of types.
@return An Observable of RemoteDataPayload.
Produces an Observable of a List of RemoteDataPayload objects corresponding to the provided types . Subscribers will be notified of any cached data upon subscription as well as subsequent changes following refresh updates provided one of the payload ' s timestamps is fresh . @param types A collection of types . @return An Observable of RemoteDataPayload .
public Observable<Collection<RemoteDataPayload>> payloadsForTypes(@NonNull final Collection<String> types) {
        return Observable.concat(cachedPayloads(types), payloadUpdates)
                         .map(new Function<Set<RemoteDataPayload>, Map<String, Collection<RemoteDataPayload>>>() {
                             @Override
                             public Map<String, Collection<RemoteDataPayload>> apply(Set<RemoteDataPayload> payloads) {
                                 Map<String, Collection<RemoteDataPayload>> map = new HashMap<>();
                                 for (RemoteDataPayload payload : payloads) {
                                     if (!map.containsKey(payload.getType())) {
                                         map.put(payload.getType(), new HashSet<RemoteDataPayload>());
                                     }
                                     map.get(payload.getType()).add(payload);
                                 }
                                 return map;
                             }
                         })
                         .map(new Function<Map<String, Collection<RemoteDataPayload>>, Collection<RemoteDataPayload>>() {
                             @Override
                             public Collection<RemoteDataPayload> apply(Map<String, Collection<RemoteDataPayload>> payloadMap) {
                                 Set<RemoteDataPayload> payloads = new HashSet<>();
                                 for (String type : new HashSet<>(types)) {
                                     if (payloadMap.containsKey(type)) {
                                         payloads.addAll(payloadMap.get(type));
                                     } else {
                                         payloads.add(new RemoteDataPayload(type, 0, JsonMap.newBuilder().build()));
                                     }
                                 }
                                 return payloads;
                             }
                         })
                         .distinctUntilChanged();
    }
public Observable < Collection < RemoteDataPayload > > payloadsForTypes ( @ NonNull final Collection < String > types ) { return Observable . concat ( cachedPayloads ( types ) , payloadUpdates ) . map ( new Function < Set < RemoteDataPayload > , Map < String , Collection < RemoteDataPayload > > > ( ) { @ Override public Map < String , Collection < RemoteDataPayload > > apply ( Set < RemoteDataPayload > payloads ) { Map < String , Collection < RemoteDataPayload > > map = new HashMap < > ( ) ; for ( RemoteDataPayload payload : payloads ) { if ( ! map . containsKey ( payload . getType ( ) ) ) { map . put ( payload . getType ( ) , new HashSet < RemoteDataPayload > ( ) ) ; } map . get ( payload . getType ( ) ) . add ( payload ) ; } return map ; } } ) . map ( new Function < Map < String , Collection < RemoteDataPayload > > , Collection < RemoteDataPayload > > ( ) { @ Override public Collection < RemoteDataPayload > apply ( Map < String , Collection < RemoteDataPayload > > payloadMap ) { Set < RemoteDataPayload > payloads = new HashSet < > ( ) ; for ( String type : new HashSet < > ( types ) ) { if ( payloadMap . containsKey ( type ) ) { payloads . addAll ( payloadMap . get ( type ) ) ; } else { payloads . add ( new RemoteDataPayload ( type , 0 , JsonMap . newBuilder ( ) . build ( ) ) ) ; } } return payloads ; } } ) . distinctUntilChanged ( ) ; }
Produces an Observable of a List of RemoteDataPayload objects corresponding to the provided types.
Produces an Observable of a List of RemoteDataPayload objects corresponding to the provided types .