<divclass="inheritance"title="Inheritance Tree"><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">java.lang.Object</a>
<dd><code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
</dl>
<dlclass="notes">
<dt>Direct Known Subclasses:</dt>
<dd><code><ahref="LazyMetadataValue.html"title="class in org.bukkit.metadata">LazyMetadataValue</a></code></dd>
</dl>
<hr>
<divclass="type-signature"><spanclass="modifiers">public abstract class </span><spanclass="element-name type-name-label">MetadataValueAdapter</span>
<spanclass="extends-implements">extends <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a>
implements <ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></span></div>
<divclass="block">Optional base class for facilitating MetadataValue implementations.
<p>
This provides all the conversion functions for MetadataValue so that
writing an implementation of MetadataValue is as simple as implementing
value() and invalidate().</div>
</section>
<sectionclass="summary">
<ulclass="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<sectionclass="field-summary"id="field-summary">
<h2>Field Summary</h2>
<divclass="caption"><span>Fields</span></div>
<divclass="summary-table three-column-summary">
<divclass="table-header col-first">Modifier and Type</div>
<divclass="col-first even-row-color"><code>protected final <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/WeakReference.html"title="class or interface in java.lang.ref"class="external-link">WeakReference</a><<ahref="../plugin/Plugin.html"title="interface in org.bukkit.plugin">Plugin</a>></code></div>
<divclass="col-constructor-name even-row-color"><code><ahref="#%3Cinit%3E(org.bukkit.plugin.Plugin)"class="member-name-link">MetadataValueAdapter</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="../plugin/Plugin.html"title="interface in org.bukkit.plugin">Plugin</a> owningPlugin)</code></div>
<divclass="block">Attempts to convert the value of this metadata item into a short.</div>
</div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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/lang/String.html"title="class or interface in java.lang"class="external-link">String</a></code></div>
<divclass="block">Attempts to convert the value of this metadata item into a string.</div>
</div>
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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><ahref="../plugin/Plugin.html"title="interface in org.bukkit.plugin">Plugin</a></code></div>
<divclass="block">Returns the <ahref="../plugin/Plugin.html"title="interface in org.bukkit.plugin"><code>Plugin</code></a> that created this metadata item.</div>
</div>
</div>
</div>
</div>
<divclass="inherited-list">
<h3id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a></h3>
<code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()"title="class or interface in java.lang"class="external-link">clone</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)"title="class or interface in java.lang"class="external-link">equals</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()"title="class or interface in java.lang"class="external-link">finalize</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()"title="class or interface in java.lang"class="external-link">getClass</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()"title="class or interface in java.lang"class="external-link">hashCode</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()"title="class or interface in java.lang"class="external-link">notify</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()"title="class or interface in java.lang"class="external-link">notifyAll</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()"title="class or interface in java.lang"class="external-link">toString</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)"title="class or interface in java.lang"class="external-link">wait</a></code></div>
<divclass="inherited-list">
<h3id="methods-inherited-from-class-org.bukkit.metadata.MetadataValue">Methods inherited from interface org.bukkit.metadata.<ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></h3>
<divclass="member-signature"><spanclass="modifiers">protected final</span> <spanclass="return-type"><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/WeakReference.html"title="class or interface in java.lang.ref"class="external-link">WeakReference</a><<ahref="../plugin/Plugin.html"title="interface in org.bukkit.plugin">Plugin</a>></span> <spanclass="element-name">owningPlugin</span></div>
<divclass="member-signature"><spanclass="modifiers">protected</span> <spanclass="element-name">MetadataValueAdapter</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="../plugin/Plugin.html"title="interface in org.bukkit.plugin">Plugin</a> owningPlugin)</span></div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<sectionclass="method-details"id="method-detail">
<h2>Method Details</h2>
<ulclass="member-list">
<li>
<sectionclass="detail"id="getOwningPlugin()">
<h3>getOwningPlugin</h3>
<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="modifiers">public</span> <spanclass="return-type"><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><ahref="../plugin/Plugin.html"title="interface in org.bukkit.plugin">Plugin</a></span> <spanclass="element-name">getOwningPlugin</span>()</div>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#getOwningPlugin()">MetadataValue</a></code></span></div>
<divclass="block">Returns the <ahref="../plugin/Plugin.html"title="interface in org.bukkit.plugin"><code>Plugin</code></a> that created this metadata item.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#getOwningPlugin()">getOwningPlugin</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<dt>Returns:</dt>
<dd>the plugin that owns this metadata value. Could be null if the plugin was already unloaded.</dd>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asInt()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into an int.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asInt()">asInt</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asFloat()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into a float.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asFloat()">asFloat</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asDouble()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into a double.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asDouble()">asDouble</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asLong()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into a long.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asLong()">asLong</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asShort()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into a short.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asShort()">asShort</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asByte()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into a byte.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asByte()">asByte</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asBoolean()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into a boolean.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asBoolean()">asBoolean</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>
<dt>Returns:</dt>
<dd>the value as a boolean.</dd>
</dl>
</section>
</li>
<li>
<sectionclass="detail"id="asString()">
<h3>asString</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="modifiers">public</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/lang/String.html"title="class or interface in java.lang"class="external-link">String</a></span> <spanclass="element-name">asString</span>()</div>
<divclass="block"><spanclass="descfrm-type-label">Description copied from interface: <code><ahref="MetadataValue.html#asString()">MetadataValue</a></code></span></div>
<divclass="block">Attempts to convert the value of this metadata item into a string.</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="MetadataValue.html#asString()">asString</a></code> in interface <code><ahref="MetadataValue.html"title="interface in org.bukkit.metadata">MetadataValue</a></code></dd>