@Test(expected = IllegalArgumentException.class) public void testNullArgumentKeyToGetWithDefaultValue() { this.testee.get(null, "defaultValue"); }
@SuppressWarnings("unchecked") public <T> T get(@Nonnull String name, @Nonnull Class<T> type) { if (name == null) { throw new IllegalArgumentException("Method argument name must not be null."); } if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } if (type.isEnum()) { return getEnumInstance(name, (Class<Enum>) type); } if (type.isArray() && type.getComponentType().isEnum()) { return getEnumInstanceArray(name, type); } final Class<?> boxedType = primitiveToWrapper(type); return (T) this.map.get(name, boxedType); }
PrimitiveAndEnumSupportingValueMap implements ValueMap { @SuppressWarnings("unchecked") public <T> T get(@Nonnull String name, @Nonnull Class<T> type) { if (name == null) { throw new IllegalArgumentException("Method argument name must not be null."); } if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } if (type.isEnum()) { return getEnumInstance(name, (Class<Enum>) type); } if (type.isArray() && type.getComponentType().isEnum()) { return getEnumInstanceArray(name, type); } final Class<?> boxedType = primitiveToWrapper(type); return (T) this.map.get(name, boxedType); } }
PrimitiveAndEnumSupportingValueMap implements ValueMap { @SuppressWarnings("unchecked") public <T> T get(@Nonnull String name, @Nonnull Class<T> type) { if (name == null) { throw new IllegalArgumentException("Method argument name must not be null."); } if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } if (type.isEnum()) { return getEnumInstance(name, (Class<Enum>) type); } if (type.isArray() && type.getComponentType().isEnum()) { return getEnumInstanceArray(name, type); } final Class<?> boxedType = primitiveToWrapper(type); return (T) this.map.get(name, boxedType); } PrimitiveAndEnumSupportingValueMap(ValueMap valueMap); }
PrimitiveAndEnumSupportingValueMap implements ValueMap { @SuppressWarnings("unchecked") public <T> T get(@Nonnull String name, @Nonnull Class<T> type) { if (name == null) { throw new IllegalArgumentException("Method argument name must not be null."); } if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } if (type.isEnum()) { return getEnumInstance(name, (Class<Enum>) type); } if (type.isArray() && type.getComponentType().isEnum()) { return getEnumInstanceArray(name, type); } final Class<?> boxedType = primitiveToWrapper(type); return (T) this.map.get(name, boxedType); } PrimitiveAndEnumSupportingValueMap(ValueMap valueMap); @SuppressWarnings("unchecked") T get(@Nonnull String name, @Nonnull Class<T> type); @Override @SuppressWarnings("unchecked") T get(@Nonnull String name, T defaultValue); @Override Object get(Object key); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Object put(String key, Object value); @Override Object remove(Object key); @Override void putAll(@Nonnull Map<? extends String, ?> m); @Override void clear(); @Override @Nonnull Set<String> keySet(); @Override @Nonnull Collection<Object> values(); @Override @Nonnull Set<Entry<String, Object>> entrySet(); }
PrimitiveAndEnumSupportingValueMap implements ValueMap { @SuppressWarnings("unchecked") public <T> T get(@Nonnull String name, @Nonnull Class<T> type) { if (name == null) { throw new IllegalArgumentException("Method argument name must not be null."); } if (type == null) { throw new IllegalArgumentException("Method argument type must not be null."); } if (type.isEnum()) { return getEnumInstance(name, (Class<Enum>) type); } if (type.isArray() && type.getComponentType().isEnum()) { return getEnumInstanceArray(name, type); } final Class<?> boxedType = primitiveToWrapper(type); return (T) this.map.get(name, boxedType); } PrimitiveAndEnumSupportingValueMap(ValueMap valueMap); @SuppressWarnings("unchecked") T get(@Nonnull String name, @Nonnull Class<T> type); @Override @SuppressWarnings("unchecked") T get(@Nonnull String name, T defaultValue); @Override Object get(Object key); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Object put(String key, Object value); @Override Object remove(Object key); @Override void putAll(@Nonnull Map<? extends String, ?> m); @Override void clear(); @Override @Nonnull Set<String> keySet(); @Override @Nonnull Collection<Object> values(); @Override @Nonnull Set<Entry<String, Object>> entrySet();  }