#500: Add PersistentDataContainer#getKeys()

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot 2020-06-26 10:49:24 +10:00
parent 94dded04b6
commit 46b14c30d7

View file

@ -1,5 +1,6 @@
package org.bukkit.persistence;
import java.util.Set;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -114,6 +115,18 @@ public interface PersistentDataContainer {
@NotNull
<T, Z> Z getOrDefault(@NotNull NamespacedKey key, @NotNull PersistentDataType<T, Z> type, @NotNull Z defaultValue);
/**
* Get a set of keys present on this {@link PersistentDataContainer}
* instance.
*
* Any changes made to the returned set will not be reflected on the
* instance.
*
* @return the key set
*/
@NotNull
Set<NamespacedKey> getKeys();
/**
* Removes a custom key from the {@link PersistentDataHolder} instance.
*