接口 MetadataValue

所有已知实现类:
FixedMetadataValue, LazyMetadataValue, MetadataValueAdapter

public interface MetadataValue
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    尝试将此元数据项的值转换为boolean.
    byte
    尝试将此元数据项的值转换为byte.
    double
    尝试将此元数据项的值转换为double.
    float
    尝试将此元数据项的值转换为float.
    int
    尝试将此元数据项的值转换为int.
    long
    尝试将此元数据项的值转换为long.
    short
    尝试将此元数据项的值转换为short.
    尝试将此元数据项的值转换为字符串.
    返回创建此元数据项的Plugin.
    void
    使此元数据项无效, 强制其在下次访问时重新计算.
    获取此元数据项的值.
  • 方法详细资料

    • value

      获取此元数据项的值.

      原文: Fetches the value of this metadata item.

      返回:
      元数据值.
    • asInt

      int asInt()
      尝试将此元数据项的值转换为int.

      原文: Attempts to convert the value of this metadata item into an int.

      返回:
      int类型的值.
    • asFloat

      float asFloat()
      尝试将此元数据项的值转换为float.

      原文: Attempts to convert the value of this metadata item into a float.

      返回:
      float类型的值.
    • asDouble

      double asDouble()
      尝试将此元数据项的值转换为double.

      原文: Attempts to convert the value of this metadata item into a double.

      返回:
      double类型的值.
    • asLong

      long asLong()
      尝试将此元数据项的值转换为long.

      原文: Attempts to convert the value of this metadata item into a long.

      返回:
      long类型的值.
    • asShort

      short asShort()
      尝试将此元数据项的值转换为short.

      原文: Attempts to convert the value of this metadata item into a short.

      返回:
      short类型的值.
    • asByte

      byte asByte()
      尝试将此元数据项的值转换为byte.

      原文: Attempts to convert the value of this metadata item into a byte.

      返回:
      byte类型的值.
    • asBoolean

      boolean asBoolean()
      尝试将此元数据项的值转换为boolean.

      原文: Attempts to convert the value of this metadata item into a boolean.

      返回:
      boolean类型的值.
    • asString

      尝试将此元数据项的值转换为字符串.

      原文: Attempts to convert the value of this metadata item into a string.

      返回:
      字符串类型的值.
    • getOwningPlugin

      @Nullable @Nullable Plugin getOwningPlugin()
      返回创建此元数据项的Plugin.

      原文: Returns the Plugin that created this metadata item.

      返回:
      拥有此元数据值的插件. 如果插件已被卸载则可能为null.
    • invalidate

      void invalidate()
      使此元数据项无效, 强制其在下次访问时重新计算.

      原文: Invalidates this metadata item, forcing it to recompute when next accessed.