Guava ImmutableMultimap - 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 ImmutableMultimap class.

This code example shows how to use the following methods:get
 
        output.println("Done!");
    } 
 
    private static int parseRuns(ImmutableMultimap<String, String> parameters) {
        final ImmutableList<String> runs = parameters.get("runs").asList();
        if (runs.isEmpty()) {
            return 1; 
        } else { 
            try { 
                return Integer.parseInt(runs.get(0));
            } catch (NumberFormatException ignored) {
                return 1; 
            } 
        } 
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:equals
      return false; 
    if (state == null) {
      if (other.state != null)
        return false; 
    } 
    else if (!state.equals(other.state))
      return false; 
    return true; 
  } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:get
    private List<String> getLoggerNames(ImmutableMultimap<String, String> parameters) {
        return parameters.get("logger").asList();
    } 
 
    private Level getLoggerLevel(ImmutableMultimap<String, String> parameters) {
        final List<String> loggerLevels = parameters.get("level").asList();
        return loggerLevels.isEmpty() ? null : Level.valueOf(loggerLevels.get(0));
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:get
 
        output.println("Done!");
    } 
 
    private static int parseRuns(ImmutableMultimap<String, String> parameters) {
        final ImmutableList<String> runs = parameters.get("runs").asList();
        if (runs.isEmpty()) {
            return 1; 
        } else { 
            try { 
                return Integer.parseInt(runs.get(0));
            } catch (NumberFormatException ignored) {
                return 1; 
            } 
        } 
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:isEmpty
    String request = post.getRequest();
    ImmutableMultimap<String, Object> params = post.getParams();
 
    // THEN 
    assertEquals(url, request);
    assertTrue(params.isEmpty()); 
  } 
 
  @Test
  public void testWithParam() { 
    // GIVEN 
    String url = "http://localhost/";
    Post post = new Post(url).postParam("a", "b");
 
    // WHEN 
    String request = post.getRequest();
    ImmutableMultimap<String, Object> params = post.getParams();
 
    // THEN 
    assertEquals(url, request);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:asMap
		Collection<String> values = parameters.get(name);		
		return values.isEmpty() ? null : values.iterator().next();
	} 
	 
	public Map<String, Collection<String>> getParameters() {
		return parameters.asMap();
	}	 
	 
	public String getBody() {
		return body;
	}	 
	 
	public InetAddress getRemoteHost() {
		return remoteHost;
	} 
 
	public InetAddress getServerHost() {
		return serverHost;
	} 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:containsEntry
      this.keys = keysToScrub;
   } 
 
   @Override 
   public String transform(String section, String key, String value) {
      if (keys.containsEntry(section, key)) {
         return "********"; 
      } else { 
         return value;
      } 
   } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:equals
        if (!(other instanceof Args)) { 
            return false; 
        } 
 
        Args args = (Args) other;
        return args._options.equals(_options)
            && args._arguments.equals(_arguments)
            && args._oneChar.equals(_oneChar);
    } 
 
    @Override 
    public int hashCode() 
    { 
        return Objects.hashCode(_options, _arguments);
    } 
 
    private static void quote(String in, StringBuilder out)
    { 
        for (int i = 0; i < in.length(); i++) {
            switch (in.charAt(i)) {
2
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:isEmpty
This code example shows how to use the following methods:isEmpty
See Code Examples for Guava ImmutableMultimap Methods: