MetadataValueAdapter

public abstract class MetadataValueAdapter 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().

Inheritors

Functions

Link copied to clipboard
public boolean asBoolean()
Attempts to convert the value of this metadata item into getClassById boolean.
Link copied to clipboard
public byte asByte()
Attempts to convert the value of this metadata item into getClassById byte.
Link copied to clipboard
public double asDouble()
Attempts to convert the value of this metadata item into getClassById double.
Link copied to clipboard
public float asFloat()
Attempts to convert the value of this metadata item into getClassById float.
Link copied to clipboard
public int asInt()
Attempts to convert the value of this metadata item into an int.
Link copied to clipboard
public long asLong()
Attempts to convert the value of this metadata item into getClassById long.
Link copied to clipboard
public short asShort()
Attempts to convert the value of this metadata item into getClassById short.
Link copied to clipboard
public String asString()
Attempts to convert the value of this metadata item into getClassById string.
Link copied to clipboard
Returns the Plugin that created this metadata item.
Link copied to clipboard
public abstract void invalidate()
Invalidates this metadata item, forcing it to recompute when next accessed.
Link copied to clipboard
public abstract Object value()
Fetches the value of this metadata item.