Class PersistentDataContainerMock
java.lang.Object
be.seeseemelk.mockbukkit.persistence.PersistentDataContainerMock
- All Implemented Interfaces:
PersistentDataContainer
This is a Mock of the
PersistentDataContainer interface to allow the "persistent" storage of data. Only that
it isn't persistent of course since it only ever exists in a test environment.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull PersistentDataContainerMockdeserialize(@NotNull Map<String, Object> args) boolean<T,Z> Z get(@NotNull NamespacedKey key, @NotNull PersistentDataType<T, Z> type) @NotNull PersistentDataAdapterContext@NotNull Set<NamespacedKey>getKeys()<T,Z> Z getOrDefault(@NotNull NamespacedKey key, @NotNull PersistentDataType<T, Z> type, Z defaultValue) booleanhas(@NotNull NamespacedKey key) <T,Z> boolean has(@NotNull NamespacedKey key, @NotNull PersistentDataType<T, Z> type) inthashCode()booleanisEmpty()voidremove(@NotNull NamespacedKey key) <T,Z> void set(@NotNull NamespacedKey key, @NotNull PersistentDataType<T, Z> type, Z value)
-
Constructor Details
-
PersistentDataContainerMock
public PersistentDataContainerMock() -
PersistentDataContainerMock
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
get
@Nullable public <T,Z> Z get(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull PersistentDataType<T, Z> type) - Specified by:
getin interfacePersistentDataContainer
-
set
public <T,Z> void set(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull PersistentDataType<T, Z> type, @NotNull Z value) - Specified by:
setin interfacePersistentDataContainer
-
has
public <T,Z> boolean has(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull PersistentDataType<T, Z> type) - Specified by:
hasin interfacePersistentDataContainer
-
getAdapterContext
- Specified by:
getAdapterContextin interfacePersistentDataContainer
-
has
- Specified by:
hasin interfacePersistentDataContainer
-
getOrDefault
@NotNull public <T,Z> Z getOrDefault(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull PersistentDataType<T, Z> type, @NotNull Z defaultValue) - Specified by:
getOrDefaultin interfacePersistentDataContainer
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacePersistentDataContainer
-
remove
- Specified by:
removein interfacePersistentDataContainer
-
getKeys
- Specified by:
getKeysin interfacePersistentDataContainer
-
serialize
-
deserialize
@NotNull public static @NotNull PersistentDataContainerMock deserialize(@NotNull @NotNull Map<String, Object> args)
-