Package org.spongepowered.api.data
Interface SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>
-
- All Superinterfaces:
CopyableDataHolder,DataHolder,DataHolder.Immutable<I>,DataSerializable,SerializableDataHolder,ValueContainer
- All Known Subinterfaces:
BlockSnapshot,BlockState,EntitySnapshot,FluidStackSnapshot,FluidState,ItemStackSnapshot,LocatableBlock,LocatableSnapshot<T>,State<S>
- Enclosing interface:
- SerializableDataHolder
public static interface SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>> extends SerializableDataHolder, DataHolder.Immutable<I>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Icopy()Creates a clone copy of thisCopyableDataHolderas a newCopyableDataHoldersuch that all theValues are safely duplicated to the new instance.IwithRawData(DataView container)Attempts to set all data of thisDataHolderaccording to theDataView's held information.-
Methods inherited from interface org.spongepowered.api.data.DataHolder.Immutable
mergeWith, mergeWith, transform, transform, with, with, with, without, without, without
-
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawData
-
-
-
-
Method Detail
-
withRawData
I withRawData(DataView container) throws InvalidDataException
Attempts to set all data of thisDataHolderaccording to theDataView's held information. Using this to modify known to beKeys provided dynamically throughDataProviders is unsupported. The format of theDataView's contained data is dependent on the type ofDataHolder.Mutablethis is. In some cases, the format is specified based on a more specific type, such as forEntityTypes, orItemTypes.This setter is used to provide setting custom data that is not represented by the Data API, including forge mods and other unknown data. Attempts to validate the provided view is not always possible due to the nature of the data being parsed by the implementation, and only understood by clients. Other cases where the data can be validated and the data is incompatible will end up throwing an
InvalidDataException.- Parameters:
container- A container containing all raw data to set on this data holder- Returns:
- The new immutable data holder containing the raw data
- Throws:
InvalidDataException- If the container is missing or has invalid data that this holder will refuse
-
copy
I copy()
Description copied from interface:CopyableDataHolderCreates a clone copy of thisCopyableDataHolderas a newCopyableDataHoldersuch 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 interfaceCopyableDataHolder- Specified by:
copyin interfaceSerializableDataHolder- Returns:
- The new copy
-
-