Example usage for java.util Map putAll

List of usage examples for java.util Map putAll

Introduction

In this page you can find the example usage for java.util Map putAll.

Prototype

void putAll(Map<? extends K, ? extends V> m);

Source Link

Document

Copies all of the mappings from the specified map to this map (optional operation).

Usage

From source file:de.micromata.genome.gwiki.page.search.expr.SearchExpressionIndexerCallback.java

protected void rebuildIndex(final GWikiContext wikiContext, GWikiElementInfo ei) {
    IndexStoragePersistHandler pe = new IndexStoragePersistHandler();
    GWikiFileStorage storage = (GWikiFileStorage) wikiContext.getWikiWeb().getStorage();
    // TODO gwiki read lock
    GWikiElement el = storage.loadElementImpl(ei);
    Map<String, GWikiArtefakt<?>> parts = storage.getParts(el);
    Map<String, GWikiArtefakt<?>> cp = new HashMap<String, GWikiArtefakt<?>>();
    Map<String, GWikiArtefakt<?>> np = new HashMap<String, GWikiArtefakt<?>>();
    cp.putAll(parts);
    pe.onPersist(wikiContext, storage, el, parts);
    for (Map.Entry<String, GWikiArtefakt<?>> me : parts.entrySet()) {
        if (cp.containsKey(me.getKey()) == false) {
            np.put(me.getKey(), me.getValue());
        }/*  w w  w .java  2s. co m*/
    }
    storage.storeImplNoTrans(el, np);
}

From source file:eu.eubrazilcc.lvl.service.rest.LvlInstanceResource.java

@GET
@Path("stats/collection")
@Produces(APPLICATION_JSON)/*  ww w  . jav  a 2s  .  com*/
public Map<String, List<SimpleStat>> getCollectionStatistics() {
    final Map<String, List<SimpleStat>> stats = leishmaniaStats();
    stats.putAll(sandflyStats());
    return stats;
}

From source file:pl.bristleback.server.bristle.integration.spring.BristleSpringIntegration.java

public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotation) {
    Map<String, Object> beans = actualContext.getBeansWithAnnotation(annotation);
    beans.putAll(bristlebackFrameworkContext.getBeansWithAnnotation(annotation));
    return beans;
}

From source file:se.inera.certificate.proxy.filter.RequestContextImpl.java

@Override
public Map<String, String> getHeaders(HttpServletRequest httpServletRequest) {
    Map<String, String> headers = newHashMap();
    headers.put("X-Proxy-Original-Mapping-Mapped-From", mapping.getContext());
    headers.put("X-Proxy-Original-Mapping-Mapped-To", mapping.getMappedPath());
    headers.putAll(filter.getHeaders(httpServletRequest));
    return headers;
}

From source file:com.vmware.identity.openidconnect.protocol.TokenRequest.java

private Map<String, String> toParameters() {
    Map<String, String> result = new HashMap<String, String>();

    result.putAll(this.authzGrant.toParameters());
    if (this.scope != null) {
        result.put("scope", this.scope.toString());
    }//w  w w . java 2s  .  co  m
    if (this.solutionUserAssertion != null) {
        result.put("solution_user_assertion", this.solutionUserAssertion.serialize());
    }
    if (this.clientAssertion != null) {
        result.put("client_assertion", this.clientAssertion.serialize());
        result.put("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
    }
    if (this.correlationId != null) {
        result.put("correlation_id", this.correlationId.getValue());
    }

    return result;
}

From source file:delfos.dataset.generated.modifieddatasets.pseudouser.PseudoUserRatingsDataset.java

@Override
public Map<Integer, RatingType> getItemRatingsRated(Integer idItem) throws ItemNotFound {

    Map<Integer, RatingType> itemRatingsRated = originalDatasetLoader.getRatingsDataset()
            .getItemRatingsRated(idItem);

    Collection<RatingType> ratedByPseudoUsers = pseudoUsersRatings.values().parallelStream()
            .flatMap(pseudoUserRatings -> pseudoUserRatings.values().stream())
            .filter(rating -> rating.getIdItem() == idItem).collect(Collectors.toList());

    Map<Integer, RatingType> itemsRatingsRated_byPseudoUsers = ratedByPseudoUsers.stream()
            .collect(Collectors.toMap(rating -> rating.getIdItem(), rating -> rating));

    Map<Integer, RatingType> ret = new TreeMap<>();

    ret.putAll(itemRatingsRated);
    ret.putAll(itemsRatingsRated_byPseudoUsers);

    return ret;// w w w  . j  av  a2  s .c  o m
}

From source file:com.qwazr.library.LibraryManagerImpl.java

private void buildGlobalMap() {
    final Map<String, AbstractLibrary> libraries = new HashMap<>();
    libraryFileMap.forEach((file, libraryMap) -> libraries.putAll(libraryMap));
    setMap(libraries);// w ww.  j a  v a 2  s .  c o  m
}

From source file:de.vanita5.twittnuker.provider.TwidereDataProvider.java

private static Cursor getPreferencesCursor(final SharedPreferencesWrapper preferences, final String key) {
    final MatrixCursor c = new MatrixCursor(TwidereDataStore.Preferences.MATRIX_COLUMNS);
    final Map<String, Object> map = new HashMap<>();
    final Map<String, ?> all = preferences.getAll();
    if (key == null) {
        map.putAll(all);
    } else {/*w  w w .jav a2s  .  com*/
        map.put(key, all.get(key));
    }
    for (final Map.Entry<String, ?> item : map.entrySet()) {
        final Object value = item.getValue();
        final int type = getPreferenceType(value);
        c.addRow(new Object[] { item.getKey(), ParseUtils.parseString(value), type });
    }
    return c;
}

From source file:org.hdiv.config.annotation.LongLivingPagesRegistry.java

protected Map<String, String> getLongLivingPages() {

    Map<String, String> all = new HashMap<String, String>();

    for (LongLivingPagesRegistration regitration : registrations) {
        Map<String, String> pages = regitration.getLongLivingPages();
        all.putAll(pages);
    }// w ww .ja  v  a 2s  . c  om
    return all;
}

From source file:nu.yona.server.test.util.BaseSpringIntegrationTest.java

@Before
public final void setUpPerTestBase() {
    MockitoAnnotations.initMocks(this);

    Map<Class<?>, Repository<?, ?>> repositoriesMap = new HashMap<>();
    repositoriesMap.put(User.class, userRepository);
    repositoriesMap.put(UserAnonymized.class, userAnonymizedRepository);
    repositoriesMap.putAll(getRepositories());
    Set<CrudRepository<?, ?>> crudRepositories = filterForCrudRepositories(repositoriesMap.values());
    crudRepositories.forEach(CrudRepository::deleteAll);
    crudRepositories.stream().filter(this::isMock).forEach(r -> JUnitUtil.setUpRepositoryMock(r));
    JUnitUtil.setUpRepositoryProviderMock(repositoriesMap);
}