/// <summary> /// Returns the map to which the specified property key is mapped, or /// an empty map if this properties contains no mapping for the property key. /// Note that the empty map is not mapped to the property key. /// </summary> /// <param name="property"> /// the property key whose associated map is to be returned </param> /// <returns> the map to which the specified property key is mapped, or /// an empty map if this properties contains no mapping for the property key /// </returns> /// <seealso cref= #putMapEntry(PropertyMapKey, Object, Object) </seealso> //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public <K, V> java.util.Map<K, V> get(PropertyMapKey<K, V> property) public virtual IDictionary <K, V> get <K, V>(PropertyMapKey <K, V> property) { if (contains(property)) { return((IDictionary <K, V>)properties[property.Name]); } else { return(new Dictionary <K, V>()); } }
/// <summary> /// Insert the value to the map to which the specified property key is mapped. If /// this properties contains no mapping for the property key, the value insert to /// a new map witch is associate the the specified property key. /// </summary> /// @param <K> /// the type of keys maintained by the map </param> /// @param <V> /// the type of mapped values </param> /// <param name="property"> /// the property key whose associated list is to be added </param> /// <param name="value"> /// the value to be appended to list </param> public virtual void putMapEntry <K, V>(PropertyMapKey <K, V> property, K key, V value) { IDictionary <K, V> map = get(property); if (!property.allowsOverwrite() && map.ContainsKey(key)) { throw new ProcessEngineException("Cannot overwrite property key " + key + ". Key already exists"); } map[key] = value; if (!contains(property)) { set(property, map); } }
/// <summary> /// Returns <code>true</code> if this properties contains a mapping for the specified property key. /// </summary> /// <param name="property"> /// the property key whose presence is to be tested </param> /// <returns> <code>true</code> if this properties contains a mapping for the specified property key </returns> public virtual bool contains <T1>(PropertyMapKey <T1> property) { return(properties.ContainsKey(property.Name)); }
/// <summary> /// Associates the specified map with the specified property key. If the properties previously contained a mapping for the property key, the old /// value is replaced by the specified map. /// </summary> /// @param <K> /// the type of keys maintained by the map </param> /// @param <V> /// the type of mapped values </param> /// <param name="property"> /// the property key with which the specified map is to be associated </param> /// <param name="value"> /// the map to be associated with the specified property key </param> public virtual void set <K, V>(PropertyMapKey <K, V> property, IDictionary <K, V> value) { properties[property.Name] = value; }