Package org.spongepowered.api.data.value
Interface MapValue.Immutable<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.Immutable<Map<K,- V>> 
Represents a specialized type of 
Value.Immutable that is different
 from an CollectionValue.Immutable 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 TypeMethodDescriptiondefault MapValue.Immutable<K,V> Retrieves an immutable form of this value.Retrieves a mutable form of this value.default MapValue.Mutable<K,V> Retrieves a copy in the mutable form of this value.Retrieves the underlying value for thisValue.Immutableand applies the givenFunctiononto that value, after which, the product is sent to a newValue.Immutablereplacing this one.Creates a newValue.Immutablewith the givenEtyped value, such that if the owningValueContaineris immutable, theValueContainertoo is recreated as a new instance with the newValue.Immutable.Associates the provided key to the provided value in the new map.Associates all providedMap.Entryalong with all pre-existing map entries in a newMapValue.Immutable.Creates a newMapValue.Immutablewithout the provided key and the associated value.withoutAll(Iterable<K> keys) Creates a newMapValue.Immutablewithout the provided keys and their associated values.withoutAll(Predicate<Map.Entry<K, V>> predicate) Creates a newMapValue.Immutablesuch that all entries are filtered by the providedPredicate, any that returntrueare retained in the new value.Methods inherited from interface org.spongepowered.api.data.value.MapValuecontainsKey, containsValue, entrySet, key, keySet, size, values
- 
Method Details- 
withAssociates the provided key to the provided value in the new map. 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:
- The new value, for chaining
 
- 
withAllAssociates all providedMap.Entryalong with all pre-existing map entries in a newMapValue.Immutable.- Parameters:
- map- The map of key values to set
- Returns:
- The new value, for chaining
 
- 
withoutCreates a newMapValue.Immutablewithout the provided key and the associated value.- Parameters:
- key- The key to exclude the association
- Returns:
- The new value, for chaining
 
- 
withoutAllCreates a newMapValue.Immutablewithout the provided keys and their associated values.- Parameters:
- keys- The keys to exclude
- Returns:
- The new value, for chaining
 
- 
withoutAllCreates a newMapValue.Immutablesuch that all entries are filtered by the providedPredicate, any that returntrueare retained in the new value. Elements that returntruefromPredicate.test(Object)are kept, and those that returnfalseare excluded.- Parameters:
- predicate- The predicate to filter
- Returns:
- The new value, for chaining
 
- 
withDescription copied from interface:Value.ImmutableCreates a newValue.Immutablewith the givenEtyped value, such that if the owningValueContaineris immutable, theValueContainertoo is recreated as a new instance with the newValue.Immutable.- Specified by:
- within interface- Value.Immutable<K>
- Parameters:
- value- The value to replace
- Returns:
- The owning ValueContainer, a new instance if it too is immutable
 
- 
transformDescription copied from interface:Value.ImmutableRetrieves the underlying value for thisValue.Immutableand applies the givenFunctiononto that value, after which, the product is sent to a newValue.Immutablereplacing this one.If the ValueContainertoo is immutable, a new instance of theValueContainermay be created. If theValueContaineris mutable, the same instance of theValueContaineris retained.- Specified by:
- transformin interface- Value.Immutable<K>
- Parameters:
- function- The function to apply onto the existing value
- Returns:
- The owning ValueContainer, a new instance if it too is immutable
 
- 
asMutableMapValue.Mutable<K,V> asMutable()Description 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.Immutable<K>
- Returns:
- A mutable value
 
- 
asImmutableDescription 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.Immutable<K>
- Returns:
- An immutable value
 
 
-