Class CollectionDataType<C extends Collection<T>,T>
java.lang.Object
com.jeff_media.morepersistentdatatypes.datatypes.collections.CollectionDataType<C,T>
- Type Parameters:
C
- The type of the collectionT
- The type of the collection's elements
- All Implemented Interfaces:
PersistentDataType<PersistentDataContainer,
C>
public class CollectionDataType<C extends Collection<T>,T>
extends Object
implements PersistentDataType<PersistentDataContainer,C>
A
PersistentDataType
for Collection
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
ConstructorDescriptionCollectionDataType
(Supplier<C> supplier, PersistentDataType<?, T> dataType) Creates a newCollectionDataType
with the given collection supplier and element data type -
Method Summary
Modifier and TypeMethodDescriptionfromPrimitive
(PersistentDataContainer pdc, PersistentDataAdapterContext context) toPrimitive
(C collection, PersistentDataAdapterContext context)
-
Constructor Details
-
CollectionDataType
Creates a newCollectionDataType
with the given collection supplier and element data type- Parameters:
supplier
- The collection supplierdataType
- The element data type
-
-
Method Details
-
getPrimitiveType
- Specified by:
getPrimitiveType
in interfacePersistentDataType<C extends Collection<T>,
T>
-
getComplexType
- Specified by:
getComplexType
in interfacePersistentDataType<C extends Collection<T>,
T>
-
toPrimitive
@NotNull public PersistentDataContainer toPrimitive(@NotNull C collection, @NotNull PersistentDataAdapterContext context) - Specified by:
toPrimitive
in interfacePersistentDataType<C extends Collection<T>,
T>
-
fromPrimitive
@NotNull public C fromPrimitive(@NotNull PersistentDataContainer pdc, @NotNull PersistentDataAdapterContext context) - Specified by:
fromPrimitive
in interfacePersistentDataType<C extends Collection<T>,
T>
-