|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bukkit.metadata.MetadataValueAdapter
public abstract class MetadataValueAdapter
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().
| Field Summary | |
|---|---|
protected WeakReference<Plugin> |
owningPlugin
|
| Constructor Summary | |
|---|---|
protected |
MetadataValueAdapter(Plugin owningPlugin)
|
| Method Summary | |
|---|---|
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. |
String |
asString()
Attempts to convert the value of this metadata item into a string. |
Plugin |
getOwningPlugin()
Returns the Plugin that created this metadata item. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.bukkit.metadata.MetadataValue |
|---|
invalidate, value |
| Field Detail |
|---|
protected final WeakReference<Plugin> owningPlugin
| Constructor Detail |
|---|
protected MetadataValueAdapter(Plugin owningPlugin)
| Method Detail |
|---|
public Plugin getOwningPlugin()
MetadataValuePlugin that created this metadata item.
getOwningPlugin in interface MetadataValuepublic int asInt()
MetadataValue
asInt in interface MetadataValuepublic float asFloat()
MetadataValue
asFloat in interface MetadataValuepublic double asDouble()
MetadataValue
asDouble in interface MetadataValuepublic long asLong()
MetadataValue
asLong in interface MetadataValuepublic short asShort()
MetadataValue
asShort in interface MetadataValuepublic byte asByte()
MetadataValue
asByte in interface MetadataValuepublic boolean asBoolean()
MetadataValue
asBoolean in interface MetadataValuepublic String asString()
MetadataValue
asString in interface MetadataValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||