MetadataValue
LazyMetadataValue
public abstract class MetadataValueAdapter extends java.lang.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 | Description |
---|---|---|
protected java.lang.ref.WeakReference<Plugin> |
owningPlugin |
Modifier | Constructor | Description |
---|---|---|
protected |
MetadataValueAdapter(Plugin owningPlugin) |
Modifier and Type | Method | 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.
|
java.lang.String |
asString() |
Attempts to convert the value of this metadata item into a string.
|
Plugin |
getOwningPlugin() |
Returns the
Plugin that created this metadata item. |
invalidate, value
protected final java.lang.ref.WeakReference<Plugin> owningPlugin
protected MetadataValueAdapter(Plugin owningPlugin)
public Plugin getOwningPlugin()
MetadataValue
Plugin
that created this metadata item.getOwningPlugin
in interface MetadataValue
public int asInt()
MetadataValue
asInt
in interface MetadataValue
public float asFloat()
MetadataValue
asFloat
in interface MetadataValue
public double asDouble()
MetadataValue
asDouble
in interface MetadataValue
public long asLong()
MetadataValue
asLong
in interface MetadataValue
public short asShort()
MetadataValue
asShort
in interface MetadataValue
public byte asByte()
MetadataValue
asByte
in interface MetadataValue
public boolean asBoolean()
MetadataValue
asBoolean
in interface MetadataValue
public java.lang.String asString()
MetadataValue
asString
in interface MetadataValue
Copyright © 2018. All rights reserved.