Class PersistentDataContainerMock

java.lang.Object
be.seeseemelk.mockbukkit.persistence.PersistentDataContainerMock
All Implemented Interfaces:
org.bukkit.persistence.PersistentDataContainer

public class PersistentDataContainerMock extends Object implements org.bukkit.persistence.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 Details

    • PersistentDataContainerMock

      public PersistentDataContainerMock()
    • PersistentDataContainerMock

      public PersistentDataContainerMock(PersistentDataContainerMock mock)
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • get

      @Nullable public <T, Z> Z get(@NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull org.bukkit.persistence.PersistentDataType<T,Z> type)
      Specified by:
      get in interface org.bukkit.persistence.PersistentDataContainer
    • set

      public <T, Z> void set(@NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull org.bukkit.persistence.PersistentDataType<T,Z> type, @NotNull Z value)
      Specified by:
      set in interface org.bukkit.persistence.PersistentDataContainer
    • has

      public <T, Z> boolean has(@NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull org.bukkit.persistence.PersistentDataType<T,Z> type)
      Specified by:
      has in interface org.bukkit.persistence.PersistentDataContainer
    • getAdapterContext

      @NotNull public @NotNull org.bukkit.persistence.PersistentDataAdapterContext getAdapterContext()
      Specified by:
      getAdapterContext in interface org.bukkit.persistence.PersistentDataContainer
    • has

      public boolean has(@NotNull @NotNull org.bukkit.NamespacedKey key)
      Specified by:
      has in interface org.bukkit.persistence.PersistentDataContainer
    • getOrDefault

      @NotNull public <T, Z> Z getOrDefault(@NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull org.bukkit.persistence.PersistentDataType<T,Z> type, @NotNull Z defaultValue)
      Specified by:
      getOrDefault in interface org.bukkit.persistence.PersistentDataContainer
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.bukkit.persistence.PersistentDataContainer
    • remove

      public void remove(@NotNull @NotNull org.bukkit.NamespacedKey key)
      Specified by:
      remove in interface org.bukkit.persistence.PersistentDataContainer
    • getKeys

      public Set<org.bukkit.NamespacedKey> getKeys()
      Specified by:
      getKeys in interface org.bukkit.persistence.PersistentDataContainer
    • serialize

      public Map<String,Object> serialize()
    • deserialize

      public static PersistentDataContainerMock deserialize(Map<String,Object> args)