Package org.spongepowered.api.data.value
Interface Value.Mutable<E>
- Type Parameters:
- E- The type of element
- All Superinterfaces:
- Value<E>
- All Known Subinterfaces:
- CollectionValue.Mutable<E,,- C, - M, - I> - ListValue.Mutable<E>,- MapValue.Mutable<K,,- V> - SetValue.Mutable<E>,- WeightedCollectionValue.Mutable<E>
Represents a type of 
Value that is mutable. Simply put, the
 underlying value can always be changed without creating a new Value.Mutable.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.spongepowered.api.data.value.ValueValue.Factory, Value.Immutable<E>, Value.Mutable<E>
- 
Method SummaryModifier and TypeMethodDescriptionGets theValue.Immutableversion of thisValue.Mutablesuch that all data is duplicated across to the newValue.Immutable.default Value.Mutable<E>Retrieves a mutable form of this value.default Value.Mutable<E>Retrieves a copy in the mutable form of this value.copy()Makes an independent copy of thisValue.Mutablewith the same initial data.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.
- 
Method Details- 
setSets the underlying value to the providedvalue.- Parameters:
- value- The value to set
- Returns:
- The owning ValueContainer
 
- 
transformAttempts to transform the underlying value based on the providedFunctionsuch that the result ofFunction.apply(Object)will replace the underlying value.- Parameters:
- function- The function to apply on the existing value
- Returns:
- The owning ValueContainer
 
- 
asImmutableValue.Immutable<E> asImmutable()Gets theValue.Immutableversion of thisValue.Mutablesuch that all data is duplicated across to the newValue.Immutable. Note that once created, theValue.Immutableis not going to change.- Specified by:
- asImmutablein interface- Value<E>
- Returns:
- A new Value.Immutableinstance
 
- 
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- Value<E>
- Returns:
- A mutable value
 
- 
copyValue.Mutable<E> copy()Makes an independent copy of thisValue.Mutablewith the same initial data. Both this value and the new value will refer to the same object initially.- Returns:
- A new copy of this Value.Mutable
 
 
-