Package org.spongepowered.api.data.value
Interface MapValue.Mutable<K,V> 
- Type Parameters:
- K- The type of the key
- V- The type of the value
- All Superinterfaces:
- MapValue<K,,- V> - Value<Map<K,,- V>> - Value.Mutable<Map<K,- V>> 
Represents a specialized type of 
Value.Mutable that is different from
 a CollectionValue.Mutable such that the "elements" are
 Map.Entry. Usually, this type of value is used to represent
 a particular "type" of "key" that is associated to a particular "value".- 
Nested Class SummaryNested classes/interfaces inherited from interface org.spongepowered.api.data.value.MapValueMapValue.Immutable<K,V>, MapValue.Mutable<K, V> Nested classes/interfaces inherited from interface org.spongepowered.api.data.value.ValueValue.Factory, Value.Immutable<E>, Value.Mutable<E>
- 
Method SummaryModifier and TypeMethodDescriptionRetrieves an immutable form of this value.default MapValue.Mutable<K, V> Retrieves a mutable form of this value.default MapValue.Mutable<K, V> Retrieves a copy in the mutable form of this value.copy()Makes an independent copy of thisValue.Mutablewith the same initial data.Associates the provided key to the provided value.Associates all providedMap.Entryto this map value.Removes the association of the provided key to the value currently associated.Removes all key value associations of the provided keys.Sets the underlying value to the providedvalue.Attempts to transform the underlying value based on the providedFunctionsuch that the result ofFunction.apply(Object)will replace the underlying value.Methods inherited from interface org.spongepowered.api.data.value.MapValuecontainsKey, containsValue, entrySet, key, keySet, size, values
- 
Method Details- 
putAssociates the provided key to the provided value. If there already exists a value for the provided key, the value is replaced.- Parameters:
- key- The key to associate to the value
- value- The value associated with the key
- Returns:
- This map value, for chaining
 
- 
putAllAssociates all providedMap.Entryto this map value.- Parameters:
- map- The map of key values to set
- Returns:
- This map value, for chaining
 
- 
removeRemoves the association of the provided key to the value currently associated.- Parameters:
- key- The key to remove
- Returns:
- This map value, for chaining
 
- 
removeAllRemoves all key value associations of the provided keys.- Parameters:
- keys- The keys to remove
- Returns:
- This map value, for chaining
 
- 
removeAllApplies thePredicateto allMap.Entrywithin thisMapValue.Mutable. Any entries that are false will be removed from the map value.- Parameters:
- predicate- The predicate to filer
- Returns:
- This map value, for chaining
 
- 
setDescription copied from interface:Value.MutableSets the underlying value to the providedvalue.- Specified by:
- setin interface- Value.Mutable<K>
- Parameters:
- value- The value to set
- Returns:
- The owning ValueContainer
 
- 
transformDescription copied from interface:Value.MutableAttempts to transform the underlying value based on the providedFunctionsuch that the result ofFunction.apply(Object)will replace the underlying value.- Specified by:
- transformin interface- Value.Mutable<K>
- Parameters:
- function- The function to apply on the existing value
- Returns:
- The owning ValueContainer
 
- 
copyMapValue.Mutable<K,V> copy()Description copied from interface:Value.MutableMakes an independent copy of thisValue.Mutablewith the same initial data. Both this value and the new value will refer to the same object initially.- Specified by:
- copyin interface- Value.Mutable<K>
- Returns:
- A new copy of this Value.Mutable
 
- 
asMutableDescription copied from interface:ValueRetrieves a mutable form of this value. Due to the vague nature of the value itself, some cases can already provide aValue.Mutableinstance where this would simply return itself. In other cases, where the retrieved value is anValue.Immutableinstance, a new mutable value is created with the same key and values.
- 
asMutableCopyDescription copied from interface:ValueRetrieves a copy in the mutable form of this value. The new is created with the same key and values.- Specified by:
- asMutableCopyin interface- MapValue<K,- V> 
- Specified by:
- asMutableCopyin interface- Value<K>
- Specified by:
- asMutableCopyin interface- Value.Mutable<K>
- Returns:
- A mutable value
 
- 
asImmutableMapValue.Immutable<K,V> asImmutable()Description copied from interface:ValueRetrieves an immutable form of this value. Due to the vague nature of the value itself, some cases can already provide aValue.Immutableinstance where this would simply return itself. In other cases, where the retrieved value is aValue.Mutableinstance, a new immutable value is created with the same key and values.- Specified by:
- asImmutablein interface- MapValue<K,- V> 
- Specified by:
- asImmutablein interface- Value<K>
- Specified by:
- asImmutablein interface- Value.Mutable<K>
- Returns:
- An immutable value
 
 
-