Interface MetadataValue

All Known Implementing Classes:
FixedMetadataValue, LazyMetadataValue, MetadataValueAdapter

public interface MetadataValue
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    Attempts to convert the value of this metadata item into a boolean.
    byte
    Attempts to convert the value of this metadata item into a byte.
    double
    Attempts to convert the value of this metadata item into a double.
    float
    Attempts to convert the value of this metadata item into a float.
    int
    Attempts to convert the value of this metadata item into an int.
    long
    Attempts to convert the value of this metadata item into a long.
    short
    Attempts to convert the value of this metadata item into a short.
    Attempts to convert the value of this metadata item into a string.
    Returns the Plugin that created this metadata item.
    void
    Invalidates this metadata item, forcing it to recompute when next accessed.
    Fetches the value of this metadata item.
  • Method Details Link icon

    • value Link icon

      @Nullable Object value()
      Fetches the value of this metadata item.
      Returns:
      the metadata value.
    • asInt Link icon

      int asInt()
      Attempts to convert the value of this metadata item into an int.
      Returns:
      the value as an int.
    • asFloat Link icon

      float asFloat()
      Attempts to convert the value of this metadata item into a float.
      Returns:
      the value as a float.
    • asDouble Link icon

      double asDouble()
      Attempts to convert the value of this metadata item into a double.
      Returns:
      the value as a double.
    • asLong Link icon

      long asLong()
      Attempts to convert the value of this metadata item into a long.
      Returns:
      the value as a long.
    • asShort Link icon

      short asShort()
      Attempts to convert the value of this metadata item into a short.
      Returns:
      the value as a short.
    • asByte Link icon

      byte asByte()
      Attempts to convert the value of this metadata item into a byte.
      Returns:
      the value as a byte.
    • asBoolean Link icon

      boolean asBoolean()
      Attempts to convert the value of this metadata item into a boolean.
      Returns:
      the value as a boolean.
    • asString Link icon

      @NotNull String asString()
      Attempts to convert the value of this metadata item into a string.
      Returns:
      the value as a string.
    • getOwningPlugin Link icon

      @Nullable Plugin getOwningPlugin()
      Returns the Plugin that created this metadata item.
      Returns:
      the plugin that owns this metadata value. Could be null if the plugin was already unloaded.
    • invalidate Link icon

      void invalidate()
      Invalidates this metadata item, forcing it to recompute when next accessed.