Multimap put - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Multimap put method.

This code example shows how to use the following methods:put
 
   @Override 
   public Multimap<String, String> buildFormParameters() {
      Multimap<String, String> params = super.buildFormParameters();
      if (externalId != null)
         params.put("ExternalId", externalId.toString());
      if (durationSeconds != null)
         params.put("DurationSeconds", durationSeconds.toString());
      if (policy != null)
         params.put("Policy", policy);
      return params;
   } 
 
   /** 
    * {@inheritDoc} 
    */ 
   @Override 
   public int hashCode() { 
      return Objects.hashCode(externalId, durationSeconds, policy);
   } 
7
CodeRank
This code example shows how to use the following methods:put
		objectClasses.add("simpleSecurityObject");
	} 
 
	@Override 
	protected void getAdditionalProperties(Multimap<String, String> additionalProperties) {
		super.getAdditionalProperties(additionalProperties);
 
		additionalProperties.put("cn", getCn());
		if (getUserPasssword() != null) { 
			additionalProperties.put("userPassword", getUserPasssword());
		} 
	} 
 
	public String getCn() {
		return cn;
	} 
 
	public void setCn(String cn) {
		this.cn = cn;
	} 
7
CodeRank
This code example shows how to use the following methods:put, removeAll
      Collection<String> values = headers.get(string);
      return (values != null && values.size() >= 1) ? values.iterator().next() : null;
   } 
 
   protected void replaceHeader(String key, String value) {
      headers.removeAll(key);
      headers.put(key, value);
   } 
 
   /** 
    * {@inheritDoc} 
    */ 
   @Override 
   public Multimap<String, String> buildRequestHeaders() {
      return headers;
   } 
 
   /** 
    * {@inheritDoc} 
    */ 
6
CodeRank
This code example shows how to use the following methods:put
		} 
	} 
 
	@Override 
	protected void getAdditionalProperties(Multimap<String, String> additionalProperties) {
		super.getAdditionalProperties(additionalProperties);
 
		additionalProperties.put("o", organizationName);
		additionalProperties.put("dc", getCn());
	} 
 
	/** 
	 * Note that dn is the actual DN used; we don't prefix with o=XXX 
	 */ 
	public static OrganizationLdapEntry build(String o, String cn, LdapDN organizationDN) {
		OrganizationLdapEntry entry = OpsContext.get().getInjector().getInstance(OrganizationLdapEntry.class);
		entry.setOrganizationName(o);
		entry.setCn(cn);
		entry.setLdapDN(organizationDN);
		return entry;
7
CodeRank
This code example shows how to use the following methods:put
 
   @Override 
   public Multimap<String, String> buildFormParameters() {
      Multimap<String, String> params = super.buildFormParameters();
      if (durationSeconds != null)
         params.put("DurationSeconds", durationSeconds.toString());
      if (policy != null)
         params.put("Policy", policy);
      return params;
   } 
 
   /** 
    * {@inheritDoc} 
    */ 
   @Override 
   public int hashCode() { 
      return Objects.hashCode(durationSeconds, policy);
   } 
 
   @Override 
6
CodeRank
This code example shows how to use the following methods:put
    public <U extends T> boolean containsEntry(Class<U> key, U value) {
        return inner.containsEntry(key, value);
    } 
 
    public <U extends T> boolean put(Class<U> key, U value) {
        return inner.put(key, value);
    } 
 
    public <U extends T> boolean remove(Class<U> key, U value) {
        return inner.remove(key, value);
    } 
 
    public <U extends T> boolean putAll(Class<U> key, Iterable<? extends U> values) {
        return inner.putAll(key, values);
    } 
 
    public void clear() { 
        inner.clear();
    } 
 
6
CodeRank
This code example shows how to use the following methods:put
		return entry;
	} 
 
	@Override 
	protected void getAdditionalProperties(Multimap<String, String> additionalProperties) {
		super.getAdditionalProperties(additionalProperties);
 
		additionalProperties.put("ou", getOu());
	} 
 
	public String getOu() {
		return ou;
	} 
 
	public void setOu(String ou) {
		this.ou = ou;
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:containsKey, put, values
    } 
 
    public void put(String alias, Expression expression)
    { 
        alias = alias(alias);
        if (map.containsKey(alias)) {
            checkState(map.get(alias).contains(expression), "Alias '%s' points to different expression '%s' and '%s'", alias, expression, map.get(alias));
        } 
        else { 
            checkState(!map.values().contains(expression), "Expression '%s' is already pointed by different alias than '%s', check mapping for '%s'", expression, alias, map);
            map.put(alias, expression);
        } 
    } 
 
    private String alias(String alias)
    { 
        return alias.toLowerCase().replace("(", "").replace(")", "").replace("\"", "");
    } 
 
    public void updateAssignments(Map<Symbol, Expression> assignments)
6
CodeRank
This code example shows how to use the following methods:put, removeAll
    assertEquals(302, (int) module.provideStatus(params, "foo"));
  } 
 
  @Test
  public void testProvideSleep() { 
    assertNull(module.provideSleep(params));
    params.put("sleep", "foo");
    assertNull(module.provideSleep(params));
    params.removeAll("sleep");
    params.put("sleep", "123");
    assertEquals(123, (int) module.provideSleep(params));
  } 
 
  @Test
  public void testProvideMime() { 
    assertNull(module.provideMime(params));
    params.put("mime", "mime");
    assertEquals("mime", module.provideMime(params));
  } 
 
6
CodeRank
This code example shows how to use the following methods:put
			    
      } else if (qName.equals("Value"))
      { 
    	  attributeValue = currentText.toString().trim();
 
          attributes.put(attributeName,new AttributePair(attributeName,
                  attributeValue, false));
      }  
      else if (qName.equals("Item")) 
      { 
          System.out.println("ItemName: " + itemName);
           
          Item item = new Item(attributes);
          items.put(itemName, item);
          attributes =  LinkedHashMultimap.create();
          this.attributeName = null;
          this.attributeValue = null;
          this.itemName = null;
          inside = false;
      } 
5
CodeRank
put Method Overview
Stores a key-value pair in this multimap.
See Code Examples for other Guava Multimap Methods: