Class MapDataType<M extends Map<K,V>,K,V>
java.lang.Object
com.jeff_media.morepersistentdatatypes.datatypes.collections.MapDataType<M,K,V>
- Type Parameters:
M
- The map typeK
- The key typeV
- The value type
- All Implemented Interfaces:
PersistentDataType<PersistentDataContainer,
M>
public class MapDataType<M extends Map<K,V>,K,V>
extends Object
implements PersistentDataType<PersistentDataContainer,M>
A
PersistentDataType
for Map
s-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.persistence.PersistentDataType
PersistentDataType.PrimitivePersistentDataType<T extends Object>
-
Field Summary
Fields inherited from interface org.bukkit.persistence.PersistentDataType
BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER, TAG_CONTAINER_ARRAY
-
Constructor Summary
ConstructorDescriptionMapDataType
(Supplier<? extends M> mapSupplier, PersistentDataType<?, K> keyDataType, PersistentDataType<?, V> valueDataType) Creates a newMapDataType
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a newMapDataType.Builder
fromPrimitive
(PersistentDataContainer pdc, PersistentDataAdapterContext context) toPrimitive
(M map, PersistentDataAdapterContext context)
-
Constructor Details
-
MapDataType
public MapDataType(@NotNull Supplier<? extends M> mapSupplier, @NotNull PersistentDataType<?, K> keyDataType, @NotNull PersistentDataType<?, V> valueDataType) Creates a newMapDataType
- Parameters:
mapSupplier
- ASupplier
for the map typekeyDataType
- ThePersistentDataType
for the keysvalueDataType
- ThePersistentDataType
for the values- See Also:
-
-
Method Details
-
builder
Creates a newMapDataType.Builder
- Returns:
- A new
MapDataType.Builder
-
getPrimitiveType
- Specified by:
getPrimitiveType
in interfacePersistentDataType<M extends Map<K,
V>, K>
-
getComplexType
- Specified by:
getComplexType
in interfacePersistentDataType<M extends Map<K,
V>, K>
-
toPrimitive
@NotNull public PersistentDataContainer toPrimitive(@NotNull M map, @NotNull PersistentDataAdapterContext context) - Specified by:
toPrimitive
in interfacePersistentDataType<M extends Map<K,
V>, K>
-
fromPrimitive
@NotNull public M fromPrimitive(@NotNull PersistentDataContainer pdc, @NotNull PersistentDataAdapterContext context) - Specified by:
fromPrimitive
in interfacePersistentDataType<M extends Map<K,
V>, K>
-