MCPcopy Create free account
hub / github.com/cbeust/jcommander / findInMap

Method findInMap

src/main/java/com/beust/jcommander/FuzzyMap.java:16–32  ·  view source on GitHub ↗
(Map<? extends IKey, V> map, IKey name,
      boolean caseSensitive, boolean allowAbbreviations)

Source from the content-addressed store, hash-verified

14 }
15
16 public static <V> V findInMap(Map<? extends IKey, V> map, IKey name,
17 boolean caseSensitive, boolean allowAbbreviations) {
18 if (allowAbbreviations) {
19 return findAbbreviatedValue(map, name, caseSensitive);
20 } else {
21 if (caseSensitive) {
22 return map.get(name);
23 } else {
24 for (IKey c : map.keySet()) {
25 if (c.getName().equalsIgnoreCase(name.getName())) {
26 return map.get(c);
27 }
28 }
29 }
30 }
31 return null;
32 }
33
34 private static <V> V findAbbreviatedValue(Map<? extends IKey, V> map, IKey name,
35 boolean caseSensitive) {

Callers 3

findCommandMethod · 0.95
findProgramNameMethod · 0.95

Calls 3

findAbbreviatedValueMethod · 0.95
getMethod · 0.80
getNameMethod · 0.65

Tested by

no test coverage detected