/** * Copy the contents of a Map to the decorated {@link DynaBean}. * * @param map The Map of values to copy. * @throws UnsupportedOperationException if * <code>isReadOnly()</code> is true. */ public void putAll(final Map<? extends K, ? extends Object> map) { if (isReadOnly()) { throw new UnsupportedOperationException("Map is read only"); } for (final Map.Entry<? extends K, ?> e : map.entrySet()) { put(e.getKey(), e.getValue()); } }
/** * Copy the contents of a Map to the decorated {@link DynaBean}. * * @param map The Map of values to copy. * @throws UnsupportedOperationException if * <code>isReadOnly()</code> is true. */ public void putAll(final Map<? extends K, ? extends Object> map) { if (isReadOnly()) { throw new UnsupportedOperationException("Map is read only"); } for (final Map.Entry<? extends K, ?> e : map.entrySet()) { put(e.getKey(), e.getValue()); } }
/** * Set the value for the specified property in * the decorated {@link DynaBean}. * * @param key The {@link DynaBean}'s property name * @param value The value for the specified property. * @return The previous property's value. * @throws UnsupportedOperationException if * <code>isReadOnly()</code> is true. */ public Object put(final K key, final Object value) { if (isReadOnly()) { throw new UnsupportedOperationException("Map is read only"); } final String property = toString(key); final Object previous = getDynaBean().get(property); getDynaBean().set(property, value); return previous; }
/** * Set the value for the specified property in * the decorated {@link DynaBean}. * * @param key The {@link DynaBean}'s property name * @param value The value for the specified property. * @return The previous property's value. * @throws UnsupportedOperationException if * <code>isReadOnly()</code> is true. */ public Object put(final K key, final Object value) { if (isReadOnly()) { throw new UnsupportedOperationException("Map is read only"); } final String property = toString(key); final Object previous = getDynaBean().get(property); getDynaBean().set(property, value); return previous; }
/** * Copy the contents of a Map to the decorated {@link DynaBean}. * * @param map The Map of values to copy. * @throws UnsupportedOperationException if * <code>isReadOnly()</code> is true. */ public void putAll(final Map<? extends K, ? extends Object> map) { if (isReadOnly()) { throw new UnsupportedOperationException("Map is read only"); } for (final Map.Entry<? extends K, ?> e : map.entrySet()) { put(e.getKey(), e.getValue()); } }
/** * Set the value for the specified property in * the decorated {@link DynaBean}. * * @param key The {@link DynaBean}'s property name * @param value The value for the specified property. * @return The previous property's value. * @throws UnsupportedOperationException if * <code>isReadOnly()</code> is true. */ public Object put(final K key, final Object value) { if (isReadOnly()) { throw new UnsupportedOperationException("Map is read only"); } final String property = toString(key); final Object previous = getDynaBean().get(property); getDynaBean().set(property, value); return previous; }