List of usage examples for com.google.common.collect ClassToInstanceMap get
V get(Object key);
From source file:org.obm.push.utils.collection.ClassToInstanceAgregateView.java
@SuppressWarnings("unchecked") public <T> T get(Class<T> key) { T result = null;/*from w w w . j a va2 s. c o m*/ for (ClassToInstanceMap<V> map : maps) { V value = map.get(key); if (value != null) { if (result != null) { throw new IllegalStateException("type " + key + " is registered in several maps"); } result = (T) value; } } return result; }
From source file:com.google.errorprone.bugpatterns.collectionincompatibletype.CollectionIncompatibleTypeNegativeCases.java
public <T extends String> T subclassHasDifferentTypeParameters(ClassToInstanceMap<String> map, Class<T> klass) { return klass.cast(map.get(klass)); }
From source file:com.google.errorprone.bugpatterns.collectionincompatibletype.CollectionIncompatibleTypePositiveCases.java
public String subclassHasDifferentTypeParameters(ClassToInstanceMap<String> map, String s) { // BUG: Diagnostic contains: return map.get(s); }