<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#get(org.bukkit.NamespacedKey,org.bukkit.persistence.PersistentDataType)"class="member-name-link">get</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type)</code></div>
<divclass="block">Returns the metadata value that is stored on the
<ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> instance.</div>
</div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataAdapterContext.html"title="interface in org.bukkit.persistence">PersistentDataAdapterContext</a></code></div>
<divclass="block">Returns the adapter context this tag container uses.</div>
</div>
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a>></code></div>
<divclass="block">Get a set of keys present on this <ahref="PersistentDataContainer.html"title="interface in org.bukkit.persistence"><code>PersistentDataContainer</code></a>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#getOrDefault(org.bukkit.NamespacedKey,org.bukkit.persistence.PersistentDataType,Z)"class="member-name-link">getOrDefault</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type,
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#has(org.bukkit.NamespacedKey)"class="member-name-link">has</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key)</code></div>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#has(org.bukkit.NamespacedKey,org.bukkit.persistence.PersistentDataType)"class="member-name-link">has</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type)</code></div>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#remove(org.bukkit.NamespacedKey)"class="member-name-link">remove</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key)</code></div>
<divclass="block">Removes a custom key from the <ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> instance.</div>
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><ahref="#set(org.bukkit.NamespacedKey,org.bukkit.persistence.PersistentDataType,Z)"class="member-name-link">set</a><wbr>(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type,
<divclass="block">Stores a metadata value on the <ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> instance.</div>
Z></span> <spanclass="return-type">void</span> <spanclass="element-name">set</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
Z value)</span></div>
<divclass="block">Stores a metadata value on the <ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> instance.
<p>
This API cannot be used to manipulate minecraft data, as the values will
be stored using your namespace. This method will override any existing
value the <ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> may have stored under the provided
key.</div>
<dlclass="notes">
<dt>Type Parameters:</dt>
<dd><code>T</code> - the generic java type of the tag value</dd>
<dd><code>Z</code> - the generic type of the object to store</dd>
<dt>Parameters:</dt>
<dd><code>key</code> - the key this value will be stored under</dd>
<dd><code>type</code> - the type this tag uses</dd>
<dd><code>value</code> - the value stored in the tag</dd>
<dt>Throws:</dt>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the key is null</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the type is null</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the value is null. Removing a tag should
be done using <ahref="#remove(org.bukkit.NamespacedKey)"><code>remove(NamespacedKey)</code></a></dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html"title="class or interface in java.lang"class="external-link">IllegalArgumentException</a></code> - if no suitable adapter will be found for
the <ahref="PersistentDataType.html#getPrimitiveType()"><code>PersistentDataType.getPrimitiveType()</code></a></dd>
Z></span> <spanclass="return-type">boolean</span> <spanclass="element-name">has</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type)</span></div>
<divclass="block">Returns if the persistent metadata provider has metadata registered
matching the provided parameters.
<p>
This method will only return if the found value has the same primitive
data type as the provided key.
<p>
Storing a value using a custom <ahref="PersistentDataType.html"title="interface in org.bukkit.persistence"><code>PersistentDataType</code></a> implementation
will not store the complex data type. Therefore storing a UUID (by
storing a byte[]) will match has("key" ,
<ahref="PersistentDataType.html#BYTE_ARRAY"><code>PersistentDataType.BYTE_ARRAY</code></a>). Likewise a stored byte[] will
always match your UUID <ahref="PersistentDataType.html"title="interface in org.bukkit.persistence"><code>PersistentDataType</code></a> even if it is not 16
bytes long.
<p>
This method is only usable for custom object keys. Overwriting existing
tags, like the the display name, will not work as the values are stored
using your namespace.</div>
<dlclass="notes">
<dt>Type Parameters:</dt>
<dd><code>T</code> - the generic type of the stored primitive</dd>
<dd><code>Z</code> - the generic type of the eventually created complex object</dd>
<dt>Parameters:</dt>
<dd><code>key</code> - the key the value is stored under</dd>
<dd><code>type</code> - the type which primitive storage type has to match the value</dd>
<dt>Returns:</dt>
<dd>if a value</dd>
<dt>Throws:</dt>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the key to look up is null</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the type to cast the found object to is
<divclass="member-signature"><spanclass="annotations"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html"title="class or interface in org.jetbrains.annotations"class="external-link">@Nullable</a>
</span><spanclass="type-parameters"><T,<wbr>
Z></span> <spanclass="return-type">Z</span> <spanclass="element-name">get</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type)</span></div>
<divclass="block">Returns the metadata value that is stored on the
<ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> instance.</div>
<dlclass="notes">
<dt>Type Parameters:</dt>
<dd><code>T</code> - the generic type of the stored primitive</dd>
<dd><code>Z</code> - the generic type of the eventually created complex object</dd>
<dt>Parameters:</dt>
<dd><code>key</code> - the key to look up in the custom tag map</dd>
<dd><code>type</code> - the type the value must have and will be casted to</dd>
<dt>Returns:</dt>
<dd>the value or <code>null</code> if no value was mapped under the given
value</dd>
<dt>Throws:</dt>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the key to look up is null</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the type to cast the found object to is
null</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html"title="class or interface in java.lang"class="external-link">IllegalArgumentException</a></code> - if the value exists under the given key,
but cannot be access using the given type</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html"title="class or interface in java.lang"class="external-link">IllegalArgumentException</a></code> - if no suitable adapter will be found for
the <ahref="PersistentDataType.html#getPrimitiveType()"><code>PersistentDataType.getPrimitiveType()</code></a></dd>
<divclass="member-signature"><spanclass="annotations"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
</span><spanclass="type-parameters"><T,<wbr>
Z></span> <spanclass="return-type">Z</span> <spanclass="element-name">getOrDefault</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataType.html"title="interface in org.bukkit.persistence">PersistentDataType</a><T,<wbr>Z> type,
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
Z defaultValue)</span></div>
<divclass="block">Returns the metadata value that is stored on the
<ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> instance. If the value does not exist in the
container, the default value provided is returned.</div>
<dlclass="notes">
<dt>Type Parameters:</dt>
<dd><code>T</code> - the generic type of the stored primitive</dd>
<dd><code>Z</code> - the generic type of the eventually created complex object</dd>
<dt>Parameters:</dt>
<dd><code>key</code> - the key to look up in the custom tag map</dd>
<dd><code>type</code> - the type the value must have and will be casted to</dd>
<dd><code>defaultValue</code> - the default value to return if no value was found for
the provided key</dd>
<dt>Returns:</dt>
<dd>the value or the default value if no value was mapped under the
given value</dd>
<dt>Throws:</dt>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the key to look up is null</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the type to cast the found object to is
null</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html"title="class or interface in java.lang"class="external-link">IllegalArgumentException</a></code> - if the value exists under the given key,
but cannot be access using the given type</dd>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html"title="class or interface in java.lang"class="external-link">IllegalArgumentException</a></code> - if no suitable adapter will be found for
the <ahref="PersistentDataType.html#getPrimitiveType()"><code>PersistentDataType.getPrimitiveType()</code></a></dd>
</dl>
</section>
</li>
<li>
<sectionclass="detail"id="getKeys()">
<h3>getKeys</h3>
<divclass="member-signature"><spanclass="annotations"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
</span><spanclass="return-type"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a>></span> <spanclass="element-name">getKeys</span>()</div>
<divclass="block">Get a set of keys present on this <ahref="PersistentDataContainer.html"title="interface in org.bukkit.persistence"><code>PersistentDataContainer</code></a>
instance.
Any changes made to the returned set will not be reflected on the
<divclass="member-signature"><spanclass="return-type">void</span> <spanclass="element-name">remove</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key)</span></div>
<divclass="block">Removes a custom key from the <ahref="PersistentDataHolder.html"title="interface in org.bukkit.persistence"><code>PersistentDataHolder</code></a> instance.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>key</code> - the key</dd>
<dt>Throws:</dt>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the provided key is null</dd>
<divclass="block">Returns if the container instance is empty, therefore has no entries
inside it.</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>the boolean</dd>
</dl>
</section>
</li>
<li>
<sectionclass="detail"id="getAdapterContext()">
<h3>getAdapterContext</h3>
<divclass="member-signature"><spanclass="annotations"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
</span><spanclass="return-type"><ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="PersistentDataAdapterContext.html"title="interface in org.bukkit.persistence">PersistentDataAdapterContext</a></span> <spanclass="element-name">getAdapterContext</span>()</div>
<divclass="block">Returns the adapter context this tag container uses.</div>
<divclass="member-signature"><spanclass="return-type">boolean</span> <spanclass="element-name">has</span><wbr><spanclass="parameters">(<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a>
<ahref="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html"title="class or interface in org.jetbrains.annotations"class="external-link">@NotNull</a><ahref="../NamespacedKey.html"title="class in org.bukkit">NamespacedKey</a> key)</span></div>
<divclass="block">Returns if the persistent metadata provider has metadata registered
matching the provided key.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>key</code> - the key for which existence should be checked.</dd>
<dt>Returns:</dt>
<dd>whether the key exists</dd>
<dt>Throws:</dt>
<dd><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html"title="class or interface in java.lang"class="external-link">NullPointerException</a></code> - if the key to look up is null</dd>