public abstract class MetadataValueAdapter extends Object implements MetadataValue
This provides all the conversion functions for MetadataValue so that writing an implementation of MetadataValue is as simple as implementing value() and invalidate().
| Modifier and Type | Field and Description |
|---|---|
protected WeakReference<Plugin> |
owningPlugin |
| Modifier | Constructor and Description |
|---|---|
protected |
MetadataValueAdapter(Plugin owningPlugin) |
| Modifier and Type | Method and Description |
|---|---|
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvalidate, valueprotected final WeakReference<Plugin> owningPlugin
protected MetadataValueAdapter(Plugin owningPlugin)
public Plugin getOwningPlugin()
MetadataValuePlugin that created this metadata item.getOwningPlugin in interface MetadataValuepublic int asInt()
MetadataValueasInt in interface MetadataValuepublic float asFloat()
MetadataValueasFloat in interface MetadataValuepublic double asDouble()
MetadataValueasDouble in interface MetadataValuepublic long asLong()
MetadataValueasLong in interface MetadataValuepublic short asShort()
MetadataValueasShort in interface MetadataValuepublic byte asByte()
MetadataValueasByte in interface MetadataValuepublic boolean asBoolean()
MetadataValueasBoolean in interface MetadataValuepublic String asString()
MetadataValueasString in interface MetadataValueCopyright © 2016. All rights reserved.