Package org.spongepowered.api.data
Interface DataManipulator.Immutable
- All Superinterfaces:
- CopyableValueContainer,- DataManipulator,- ValueContainer
- Enclosing interface:
- DataManipulator
Represents an immutable 
DataManipulator. Immutable meaning that
 the contained values are all likewise
 Value.Immutable, and as such,
 cannot be changed themselves, nor can the manipulator be modified to add
 or remove values. All methods such as with(Value) return new
 instances. It is guaranteed to be thread safe to access values from this
 container, and seeing as it does not change, can be passed around as a
 pseudo cache for templating. It is important to note that there is no
 guarantee on the validity of the stored Values that their own data
 does not "expire", cases may include outdated references of
 entities or worlds that no longer serve valid
 purposes.- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA factory for generatingDataManipulator.Immutables.Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataManipulatorDataManipulator.Immutable, DataManipulator.Mutable
- 
Method SummaryModifier and TypeMethodDescriptiondefault DataManipulator.ImmutableGets anDataManipulator.Immutablecopy of thisDataManipulatorsuch that all backedValue.Mutables are copied intoValue.Immutablecounterparts.default DataManipulator.Immutablecopy()Creates a clone copy of thisCopyableValueContaineras a newCopyableValueContainersuch that all theValues are safely duplicated to the new instance.default <E> DataManipulator.ImmutableApplies a transformation on the provided value if the key is available.default <E> DataManipulator.ImmutableCreates a newDataManipulator.Immutablewith the provided value if theKeyis supported by thisDataManipulator.Immutablewithout exception.default <E> DataManipulator.ImmutableCreates a newDataManipulator.Immutablewith the providedValueprovided that theValueis supported by thisDataManipulator.Immutable.default DataManipulator.ImmutableCreates a newDataManipulator.Immutablewithout the givenKey.Methods inherited from interface org.spongepowered.api.data.DataManipulatorasMutable, asMutableCopy
- 
Method Details- 
copyDescription copied from interface:CopyableValueContainerCreates a clone copy of thisCopyableValueContaineras a newCopyableValueContainersuch that all theValues are safely duplicated to the new instance. It is not guaranteed that the returning container is of the same type as this container.- Specified by:
- copyin interface- CopyableValueContainer
- Specified by:
- copyin interface- DataManipulator
- Returns:
- The new copy
 
- 
asImmutableDescription copied from interface:DataManipulatorGets anDataManipulator.Immutablecopy of thisDataManipulatorsuch that all backedValue.Mutables are copied intoValue.Immutablecounterparts. Any changes to thisDataManipulatorwill NOT be reflected on the returnedDataManipulator.Immutableand vice versa.- Specified by:
- asImmutablein interface- DataManipulator
- Returns:
- This DataManipulator's data copied into aDataManipulator.Immutable
 
- 
withCreates a newDataManipulator.Immutablewith the provided value if theKeyis supported by thisDataManipulator.Immutablewithout exception.- Type Parameters:
- E- The type of value
- Parameters:
- key- The key to use
- value- The value to set
- Returns:
- The new immutable data manipulator
 
- 
withoutCreates a newDataManipulator.Immutablewithout the givenKey.- Parameters:
- key- The key to use
- Returns:
- The new immutable data manipulator
 
- 
withCreates a newDataManipulator.Immutablewith the providedValueprovided that theValueis supported by thisDataManipulator.Immutable.- Type Parameters:
- E- The type of value
- Parameters:
- value- The value to set
- Returns:
- The new immutable data manipulator
 
- 
transformdefault <E> DataManipulator.Immutable transform(Key<? extends Value<E>> key, Function<E, E> function) Applies a transformation on the provided value if the key is available. This is the same asDataHolder.Immutable.transform(Key, Function).- Type Parameters:
- E- The type of element
- Parameters:
- key- The key to use
- function- The function to apply
- Returns:
- This manipulator, for chaining
 
 
-