程序包 org.bukkit.metadata

# 类 MetadataValueAdapter

java.lang.Object
org.bukkit.metadata.MetadataValueAdapter

所有已实现的接口:
  `MetadataValue`

直接已知子类:
  `LazyMetadataValue`

public abstract class MetadataValueAdapter extends Object implements MetadataValue
Optional base class for facilitating MetadataValue implementations.

This provides all the conversion functions for MetadataValue so that writing an implementation of MetadataValue is as simple as implementing value() and invalidate().

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `protected final WeakReference<Plugin>`
  `owningPlugin`

- ## 构造器概要

  构造器
  限定符
  构造器
  说明
  `protected`
  `MetadataValueAdapter(@NotNull Plugin owningPlugin)`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `boolean`
  `asBoolean()`
  Attempts to convert the value of this metadata item into a boolean.
  `byte`
  `asByte()`
  Attempts to convert the value of this metadata item into a byte.
  `double`
  `asDouble()`
  Attempts to convert the value of this metadata item into a double.
  `float`
  `asFloat()`
  Attempts to convert the value of this metadata item into a float.
  `int`
  `asInt()`
  Attempts to convert the value of this metadata item into an int.
  `long`
  `asLong()`
  Attempts to convert the value of this metadata item into a long.
  `short`
  `asShort()`
  Attempts to convert the value of this metadata item into a short.
  `@NotNull String`
  `asString()`
  Attempts to convert the value of this metadata item into a string.
  `@Nullable Plugin`
  `getOwningPlugin()`
  Returns the `Plugin` that created this metadata item.

  ### 从类继承的方法 java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### 从接口继承的方法 org.bukkit.metadata.MetadataValue

  `invalidate, value`

- ## 字段详细资料

  - ### owningPlugin

    protected final WeakReference<Plugin> owningPlugin

- ## 构造器详细资料

  - ### MetadataValueAdapter

    protected MetadataValueAdapter(@NotNull @NotNull Plugin owningPlugin)

- ## 方法详细资料

  - ### getOwningPlugin

    @Nullable public @Nullable Plugin getOwningPlugin()
    从接口复制的说明: `MetadataValue`
    Returns the `Plugin` that created this metadata item.
    指定者:
      `getOwningPlugin` 在接口中 `MetadataValue`
    返回:
      the plugin that owns this metadata value. Could be null if the plugin was already unloaded.

  - ### asInt

    public int asInt()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into an int.
    指定者:
      `asInt` 在接口中 `MetadataValue`
    返回:
      the value as an int.

  - ### asFloat

    public float asFloat()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into a float.
    指定者:
      `asFloat` 在接口中 `MetadataValue`
    返回:
      the value as a float.

  - ### asDouble

    public double asDouble()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into a double.
    指定者:
      `asDouble` 在接口中 `MetadataValue`
    返回:
      the value as a double.

  - ### asLong

    public long asLong()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into a long.
    指定者:
      `asLong` 在接口中 `MetadataValue`
    返回:
      the value as a long.

  - ### asShort

    public short asShort()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into a short.
    指定者:
      `asShort` 在接口中 `MetadataValue`
    返回:
      the value as a short.

  - ### asByte

    public byte asByte()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into a byte.
    指定者:
      `asByte` 在接口中 `MetadataValue`
    返回:
      the value as a byte.

  - ### asBoolean

    public boolean asBoolean()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into a boolean.
    指定者:
      `asBoolean` 在接口中 `MetadataValue`
    返回:
      the value as a boolean.

  - ### asString

    @NotNull public @NotNull String asString()
    从接口复制的说明: `MetadataValue`
    Attempts to convert the value of this metadata item into a string.
    指定者:
      `asString` 在接口中 `MetadataValue`
    返回:
      the value as a string.