Guava ListMultimap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava ListMultimap class.

This code example shows how to use the following methods:removeAll, put
    } 
 
    @Override 
    public void putSingle(K key, V value)
    { 
        multimap.removeAll(key);
        multimap.put(key, value);
    } 
 
    @Override 
    @SuppressWarnings("RedundantCast") 
    protected Map<K, List<V>> delegate()
    { 
        // forced cast 
        return (Map<K, List<V>>) (Object) multimap.asMap();
    } 
 
    @Override 
    public void add(K key, V value)
    { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:removeAll, put
    } 
 
    @Override 
    public void putSingle(K key, V value)
    { 
        multimap.removeAll(key);
        multimap.put(key, value);
    } 
 
    @Override 
    @SuppressWarnings("RedundantCast") 
    protected Map<K, List<V>> delegate()
    { 
        // forced cast 
        return (Map<K, List<V>>) (Object) multimap.asMap();
    } 
 
    @Override 
    public void add(K key, V value)
    { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:put
public final class TimeMarkerComparisonTest 
{ 
    @Test
    public void noTimestampConflicts() { 
        ListMultimap<Long,String> alpha = newMultimap();
        alpha.put(1L, "one");
        alpha.put(3L, "three");
        ListMultimap<Long,String> beta = newMultimap();
        beta.put(2L, "two");
        test("[[one], [two], [three]]", alpha, beta);
    } 
 
    @Test
    public void conflictsWithinOne() { 
        ListMultimap<Long,String> alpha = newMultimap();
        alpha.put(1L, "oneA");
        alpha.put(1L, "oneB");
        ListMultimap<Long,String> beta = newMultimap();
        beta.put(2L, "two");
        test("[[oneA], [oneB], [two]]", alpha, beta);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:put
      if (qName.equals("OperatingSystemSection")) {
         inOs = false;
      } else if (inOs && qName.equals("Description")) {
         operatingSystemDescription = currentText.toString().trim();
      } else if (qName.endsWith("IpAddress")) {
         networkToAddresses.put(networkName, currentText.toString().trim());
      } else if (qName.equals("System")) {
         systemHandler.endElement(uri, localName, qName);
         system = systemHandler.getResult();
      } else if (qName.equals("Item")) {
         allocationHandler.endElement(uri, localName, qName);
         allocations.add(allocationHandler.getResult());
      } else { 
         systemHandler.endElement(uri, localName, qName);
         allocationHandler.endElement(uri, localName, qName);
      } 
      currentText = new StringBuilder();
   } 
 
   @Override 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:entries
    public <U extends T> List<U> replaceValues(Class<U> key, Iterable<? extends U> values) {
        return convertList(key, inner.replaceValues(key, values));
    } 
 
    public Collection<Map.Entry<Class<? extends T>, T>> entries() {
        return inner.entries();
    } 
 
    private <U extends T> List<U> convertList(Class<U> type, Collection<T> values) {
        List<U> results = Lists.newArrayListWithCapacity(values.size());
        for (T value : values) {
            results.add(type.cast(value));
        } 
        return results;
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:get, keySet
        public Void visitUnion(UnionNode node, Void context)
        { 
            visitPlan(node, context);
 
            ListMultimap<Symbol, Symbol> symbolMapping = node.getSymbolMapping();
            for (Symbol keySymbol : symbolMapping.keySet()) {
                List<Symbol> valueSymbols = symbolMapping.get(keySymbol);
                Type expectedType = types.get(keySymbol);
                for (Symbol valueSymbol : valueSymbols) {
                    verifyTypeSignature(keySymbol, expectedType.getTypeSignature(), types.get(valueSymbol).getTypeSignature());
                } 
            } 
 
            return null; 
        } 
 
        private void checkWindowFunctions(Map<Symbol, WindowNode.Function> functions)
        { 
            for (Map.Entry<Symbol, WindowNode.Function> entry : functions.entrySet()) {
                Signature signature = entry.getValue().getSignature();
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:removeAll, put
            return this;
        } 
 
        public Builder setHeader(String name, String value)
        { 
            this.headers.removeAll(name);
            this.headers.put(name, value);
            return this;
        } 
 
        public Builder addHeader(String name, String value)
        { 
            this.headers.put(name, value);
            return this;
        } 
 
        public Builder setBodyGenerator(BodyGenerator bodyGenerator)
        { 
            this.bodyGenerator = bodyGenerator;
            return this;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:removeAll, put
            return this;
        } 
 
        public Builder setHeader(String name, String value)
        { 
            this.headers.removeAll(name);
            this.headers.put(name, value);
            return this;
        } 
 
        public Builder addHeader(String name, String value)
        { 
            this.headers.put(name, value);
            return this;
        } 
 
        public Builder setBodyGenerator(BodyGenerator bodyGenerator)
        { 
            this.bodyGenerator = bodyGenerator;
            return this;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hashCode
   public int hashCode() { 
      final int prime = 31;
      int result = 1;
      result = prime * result + ((href == null) ? 0 : href.hashCode());
      result = prime * result + ((name == null) ? 0 : name.hashCode());
      result = prime * result + ((networkToAddresses == null) ? 0 : networkToAddresses.hashCode());
      result = prime * result + ((operatingSystemDescription == null) ? 0 : operatingSystemDescription.hashCode());
      result = prime * result + ((resourceAllocations == null) ? 0 : resourceAllocations.hashCode());
      result = prime * result + ((size == null) ? 0 : size.hashCode());
      result = prime * result + ((osType == null) ? 0 : osType.hashCode());
      result = prime * result + ((status == null) ? 0 : status.hashCode());
      result = prime * result + ((system == null) ? 0 : system.hashCode());
      result = prime * result + ((vDC == null) ? 0 : vDC.hashCode());
      result = prime * result + ((extendedInfo == null) ? 0 : extendedInfo.hashCode());
      return result;
   } 
 
   @Override 
   public boolean equals(Object obj) { 
      if (this == obj)
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:get
        return statusMessage;
    } 
 
    public String getHeader(String name)
    { 
        List<String> values = getHeaders().get(name);
        if (values.isEmpty()) {
            return null; 
        } 
        return values.get(0);
    } 
 
    public ListMultimap<String, String> getHeaders()
    { 
        return headers;
    } 
 
    @Override 
    public String toString()
    { 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Guava ListMultimap Methods: