List of usage examples for java.util Map putAll
void putAll(Map<? extends K, ? extends V> m);
From source file:fr.mailjet.mail.MailjetEmail.java
/** * Ajoute les headers Mailjet dans le mail <b> sans supprimer les headers * prcdents</b>. Les potentielles anciennes valeurs associes * {@link EnumMailjetMailHeader} sont crases. * //w w w . ja v a2 s . co m * @param parHeaders * {@link Map} une map de headers * @see EnumMailjetMailHeader */ @SuppressWarnings("unchecked") public void setMailjetHeaders(Map<EnumMailjetMailHeader, Object> parHeaders) { Map<String, String> locRealHeaders = new HashMap<String, String>(parHeaders.size()); locRealHeaders.putAll(this.headers); for (Map.Entry<EnumMailjetMailHeader, Object> locEntry : parHeaders.entrySet()) { locRealHeaders.put(locEntry.getKey().getConstName(), locEntry.getValue().toString()); } this.setHeaders(locRealHeaders); }
From source file:com.netflix.conductor.core.execution.tasks.Event.java
@Override public void start(Workflow workflow, Task task, WorkflowExecutor provider) throws Exception { Map<String, Object> payload = new HashMap<>(); payload.putAll(task.getInputData()); payload.put("workflowInstanceId", workflow.getWorkflowId()); payload.put("workflowType", workflow.getWorkflowType()); payload.put("workflowVersion", workflow.getVersion()); payload.put("correlationId", workflow.getCorrelationId()); String payloadJson = om.writeValueAsString(payload); Message message = new Message(task.getTaskId(), payloadJson, task.getTaskId()); ObservableQueue queue = getQueue(workflow, task); if (queue != null) { queue.publish(Arrays.asList(message)); task.setStatus(Status.COMPLETED); }//from www . j a v a 2s .c o m }
From source file:org.geppetto.persistence.db.OSGiLocalPersistenceManagerFactoryBean.java
@Override protected PersistenceManagerFactory newPersistenceManagerFactory(Map props) { ClassLoader classLoader = getClassLoader(); props.putAll(dbConnProperties); props.put("datanucleus.primaryClassLoader", classLoader); PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props, classLoader); return pmf;/*from w ww.ja v a2 s.co m*/ }
From source file:com.elasticbox.jenkins.k8s.repositories.api.PodRepositoryApiImpl.java
@Override public void create(String kubeName, String namespace, Pod pod, Map<String, String> labels) throws RepositoryException { if (labels != null) { final Map<String, String> currentLabels = pod.getMetadata().getLabels(); currentLabels.putAll(labels); pod.getMetadata().setLabels(currentLabels); }/* w w w. j a va2s . com*/ this.create(kubeName, namespace, pod); }
From source file:net.sf.jasperreports.customvisualization.export.CVElementAbstractImageDataProvider.java
public String getHtmlPage(JasperReportsContext jrContext, JRGenericPrintElement element, List<String> scripts, String cssUri) {//from w w w . j a v a 2 s.c om Map<String, Object> originalConfiguration = (Map<String, Object>) element .getParameterValue(CVPrintElement.CONFIGURATION); if (originalConfiguration == null) { if (log.isWarnEnabled()) { log.warn("Configuration object in the element " + element + " is NULL!"); } throw new JRRuntimeException("Configuration object in the element " + element + " is NULL!"); } // Duplicate the configuration. Map<String, Object> configuration = new HashMap<String, Object>(); configuration.putAll(originalConfiguration); ObjectMapper mapper = new ObjectMapper(); try { Map<String, Object> jsonConfiguration = CVElementJsonHandler.createConfigurationForJSON(configuration, null); jsonConfiguration.put("animation", false); String instanceData = mapper.writeValueAsString(jsonConfiguration); configuration.put("instanceData", instanceData); } catch (Exception ex) { if (log.isWarnEnabled()) { log.warn("Error dumping the JSON for the configuration...: " + ex.getMessage(), ex); } throw new JRRuntimeException("Error dumping the JSON for the configuration...: " + ex.getMessage()); } configuration.put("element", element); Map<String, Object> velocityContext = new HashMap<>(); velocityContext.put("elementId", CVUtils.getElementId(element)); velocityContext.put("scripts", scripts); velocityContext.put("configuration", configuration); velocityContext.put("module", element.getParameterValue(CVPrintElement.MODULE)); velocityContext.put("cssUri", cssUri); return VelocityUtil.processTemplate(PHANTOMJS_COMPONENT_TEMPLATE, velocityContext); }
From source file:com.revolsys.ui.web.config.HttpServletRequestJexlContext.java
@Override public Map getVars() { return new AbstractMap<String, Object>() { @Override/*from w w w . j a va 2s .co m*/ @SuppressWarnings("unchecked") public Set<Entry<String, Object>> entrySet() { final HttpServletRequest request = getRequest(); final Map<String, Object> map = new HashMap<>(); map.putAll(request.getParameterMap()); for (final Enumeration<String> names = request.getAttributeNames(); names.hasMoreElements();) { final String name = names.nextElement(); map.put(name, request.getAttribute(name)); } if (HttpServletRequestJexlContext.this.servletContext != null) { for (final Enumeration<String> names = HttpServletRequestJexlContext.this.servletContext .getAttributeNames(); names.hasMoreElements();) { final String name = names.nextElement(); map.put(name, HttpServletRequestJexlContext.this.servletContext.getAttribute(name)); } } final Map<String, Object> attributes = HttpServletRequestJexlContext.this.localAttributes.get(); if (attributes != null) { map.putAll(attributes); } map.put("request", request); map.put("requestURI", HttpServletRequestJexlContext.this.urlPathHelper.getOriginatingRequestUri(request)); return map.entrySet(); } }; }
From source file:de.hybris.platform.addonsupport.setup.impl.DefaultSetupImpexAddOnService.java
@Override public boolean importImpexFile(final String file, final ImpexMacroParameterData macroParameters, final boolean errorIfMissing, final boolean legacyMode) { final Map val; try {/*from ww w . j ava 2 s . c om*/ val = BeanUtils.describe(macroParameters); val.remove("additionalParameterMap"); } catch (final Exception e) { throw new IllegalArgumentException("failed to introspect macroparameters", e); } final Map mergedMap = new HashMap<String, String>(); mergedMap.putAll(val); if (macroParameters.getAdditionalParameterMap() != null) { mergedMap.putAll(macroParameters.getAdditionalParameterMap()); } return importImpexFile(file, mergedMap, errorIfMissing, legacyMode); }
From source file:nl.tue.gale.common.SpringManipulator.java
public <K, V> void setMap(Map<K, V> map) { BeanWrapper wrapper = new BeanWrapperImpl(bean); @SuppressWarnings("unchecked") Map<K, V> beanMap = new HashMap<K, V>((Map<K, V>) wrapper.getPropertyValue(property)); beanMap.putAll(map); wrapper.setPropertyValue(property, beanMap); }
From source file:ws.salient.aws.dynamodb.DynamoDBProfiles.java
@Override public Map<String, String> getAliases(String accountId, List<String> profiles) { Settings settings = getSettings(accountId); Map<String, String> aliases = new LinkedHashMap(); aliases.putAll(getSettings(ROOT_ACCOUNT_ID).getAliases(profiles)); aliases.putAll(settings.getAliases(profiles)); return aliases; }
From source file:com.alibaba.napoli.metamorphosis.utils.DiamondUtils.java
/** ??topic?(?topic) */ public static void getPartitions(final Properties properties, final Map<String, List<Partition>> ret) { log.info("??"); final Map<String, List<Partition>> map = new HashMap<String, List<Partition>>(); if (properties != null) { for (final Map.Entry<Object, Object> entry : properties.entrySet()) { final String key = (String) entry.getKey(); if (key != null && key.startsWith("topic.num.")) { // key?topic final String topic = key.substring("topic.num.".length()); // value?brokerId0:num0;brokerId1:num1;... final String value = (String) entry.getValue(); final List<Partition> partitions = parsePartitions(value); if (partitions != null && !partitions.isEmpty()) { map.put(topic, partitions); }//w w w . java 2 s . co m } } ret.clear(); ret.putAll(map); if (!ret.isEmpty()) { log.info("?: " + map); } else { log.info("empty partitionsNum info"); } } else { log.warn("Null partitionsNum config"); } }