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:com.activiti.web.rest.client.AbstractClientResource.java

protected Map<String, String[]> getRequestParametersWithoutServerId(HttpServletRequest request) {
    Map<String, String[]> parameterMap = request.getParameterMap();
    Map<String, String[]> resultMap = new HashMap<String, String[]>();
    resultMap.putAll(parameterMap);
    resultMap.remove(SERVER_ID);/* w  ww  . ja  v a 2 s  .  c  om*/
    return resultMap;
}

From source file:org.trustedanalytics.servicebroker.hdfs.plans.HdfsPlanCreateUserDirectory.java

@Override
public Map<String, Object> bind(ServiceInstance serviceInstance) throws ServiceBrokerException {
    UUID instanceId = UUID.fromString(serviceInstance.getServiceInstanceId());
    UUID orgId = UUID.fromString(serviceInstance.getOrganizationGuid());
    Map<String, Object> configurationMap = bindingOperations.createCredentialsMap(instanceId, orgId);
    Map<String, Object> storedCredentials = credentialsStore.get(instanceId);
    Map<String, Object> credentials = new HashMap<>();

    credentials.putAll(configurationMap);
    credentials.putAll(storedCredentials);
    return credentials;
}

From source file:org.rubychina.android.api.RCAPIClient.java

@Override
protected Map<String, String> makeRequestParam(RCAPIRequest<? extends RCAPIResponse> request) {
    Map<String, String> param = new HashMap<String, String>();
    param.putAll(request.getTextParams(getApiContext()));
    return param;
}

From source file:edu.cornell.mannlib.vitro.webapp.utils.developer.DeveloperSettingsServlet.java

private Map<String, Object> buildBodyMap(boolean authorized, DeveloperSettings settings) {
    Map<String, Object> settingsMap = new HashMap<>();
    settingsMap.putAll(settings.getRawSettingsMap());
    settingsMap.put("mayControl", authorized);

    Map<String, Object> bodyMap = new HashMap<>();
    bodyMap.put("settings", settingsMap);
    return bodyMap;
}

From source file:com.alibaba.cobar.client.router.rules.ibatis.IBatisNamespaceShardingRule.java

public boolean isDefinedAt(IBatisRoutingFact routingFact) {
    Validate.notNull(routingFact);//from w  ww . ja  v a 2 s  .com
    String namespace = StringUtils.substringBeforeLast(routingFact.getAction(), ".");
    boolean matches = StringUtils.equals(namespace, getTypePattern());
    if (matches) {
        try {
            Map<String, Object> vrs = new HashMap<String, Object>();
            vrs.putAll(getFunctionMap());
            vrs.put("$ROOT", routingFact.getArgument()); // add top object reference for expression
            VariableResolverFactory vrfactory = new MapVariableResolverFactory(vrs);
            if (MVEL.evalToBoolean(getAttributePattern(), routingFact.getArgument(), vrfactory)) {
                return true;
            }
        } catch (Throwable t) {
            logger.info("failed to evaluate attribute expression:'{}' with context object:'{}'\n{}",
                    new Object[] { getAttributePattern(), routingFact.getArgument(), t });
        }
    }
    return false;
}

From source file:com.alibaba.cobar.client.router.rules.ibatis.IBatisSqlActionShardingRule.java

public boolean isDefinedAt(IBatisRoutingFact routingFact) {
    Validate.notNull(routingFact);/*from   ww  w . j  a v  a2s .com*/
    boolean matches = StringUtils.equals(getTypePattern(), routingFact.getAction());
    if (matches) {
        try {
            Map<String, Object> vrs = new HashMap<String, Object>();
            vrs.putAll(getFunctionMap());
            vrs.put("$ROOT", routingFact.getArgument()); // add top object reference for expression
            VariableResolverFactory vrfactory = new MapVariableResolverFactory(vrs);
            if (MVEL.evalToBoolean(getAttributePattern(), routingFact.getArgument(), vrfactory)) {
                return true;
            }
        } catch (Throwable t) {
            logger.info("failed to evaluate attribute expression:'{}' with context object:'{}'\n{}",
                    new Object[] { getAttributePattern(), routingFact.getArgument(), t });
        }
    }

    return false;
}

From source file:de.micromata.genome.gwiki.page.impl.actionbean.CommonMultipartRequest.java

@SuppressWarnings({ "rawtypes", "unchecked" })
public Map getParameterMap() {
    Map paramMap = new HashMap();
    paramMap.putAll(getRequest().getParameterMap());
    paramMap.putAll(this.multipartParams);
    return paramMap;
}

From source file:io.mandrel.metrics.MetricsSyncer.java

@Scheduled(fixedRate = 10000)
public void sync() {
    if (stateService.isStarted()) {
        if (monitor.tryEnter()) {
            try {
                Map<String, Long> total = Maps.newHashMap();
                total.putAll(accumulators.globalAccumulator().tick());
                total.putAll(accumulators.nodeAccumulator().tick());
                accumulators.spiderAccumulators().forEach((spiderId, acc) -> total.putAll(acc.tick()));

                if (MapUtils.isNotEmpty(total)) {
                    try {
                        log.debug("Updating metrics");
                        clients.onRandomController().with(controller -> controller.updateMetrics(total));
                    } catch (Exception e) {
                        log.info("Can not update metrics {} due to", total, e);
                    }//from   w w w  . jav  a2s.c o m
                }
            } finally {
                monitor.leave();
            }
        }
    }
}

From source file:com.swdouglass.joid.CheckAuthenticationRequest.java

@Override
public Map<String, String> toMap() {
    Map<String, String> map = ar.toMap();
    map.putAll(super.toMap());
    return map;//from   w  w  w . j av a  2s . com
}

From source file:org.trustedanalytics.servicebroker.hdfs.plans.HdfsPlanGetUserDirectory.java

@Override
public Map<String, Object> bind(ServiceInstance serviceInstance) throws ServiceBrokerException {
    UUID instanceId = UUID.fromString(serviceInstance.getServiceInstanceId());
    UUID orgId = UUID.fromString(serviceInstance.getOrganizationGuid());
    Map<String, Object> configurationMap = bindingOperations.createCredentialsMap(instanceId, orgId);
    Map<String, Object> storedCredentials = credentialsStore.get(instanceId);

    if (getParameterUri(storedCredentials, URI_KEY).isPresent()) {
        configurationMap.remove(URI_KEY);
    }/*  ww w  .ja  v a  2 s . com*/

    Map<String, Object> credentials = new HashMap<>();
    credentials.putAll(configurationMap);
    credentials.putAll(storedCredentials);
    return credentials;
}