Package org.bukkit.metadata
Class MetadataValueAdapter
java.lang.Object
org.bukkit.metadata.MetadataValueAdapter
- All Implemented Interfaces:
- MetadataValue
- Direct Known Subclasses:
- LazyMetadataValue
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 SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanAttempts to convert the value of this metadata item into a boolean.byteasByte()Attempts to convert the value of this metadata item into a byte.doubleasDouble()Attempts to convert the value of this metadata item into a double.floatasFloat()Attempts to convert the value of this metadata item into a float.intasInt()Attempts to convert the value of this metadata item into an int.longasLong()Attempts to convert the value of this metadata item into a long.shortasShort()Attempts to convert the value of this metadata item into a short.asString()Attempts to convert the value of this metadata item into a string.Returns thePluginthat created this metadata item.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.metadata.MetadataValueinvalidate, value
- 
Field Details- 
owningPlugin
 
- 
- 
Constructor Details- 
MetadataValueAdapter
 
- 
- 
Method Details- 
getOwningPluginDescription copied from interface:MetadataValueReturns thePluginthat created this metadata item.- Specified by:
- getOwningPluginin interface- MetadataValue
- Returns:
- the plugin that owns this metadata value. Could be null if the plugin was already unloaded.
 
- 
asIntpublic int asInt()Description copied from interface:MetadataValueAttempts to convert the value of this metadata item into an int.- Specified by:
- asIntin interface- MetadataValue
- Returns:
- the value as an int.
 
- 
asFloatpublic float asFloat()Description copied from interface:MetadataValueAttempts to convert the value of this metadata item into a float.- Specified by:
- asFloatin interface- MetadataValue
- Returns:
- the value as a float.
 
- 
asDoublepublic double asDouble()Description copied from interface:MetadataValueAttempts to convert the value of this metadata item into a double.- Specified by:
- asDoublein interface- MetadataValue
- Returns:
- the value as a double.
 
- 
asLongpublic long asLong()Description copied from interface:MetadataValueAttempts to convert the value of this metadata item into a long.- Specified by:
- asLongin interface- MetadataValue
- Returns:
- the value as a long.
 
- 
asShortpublic short asShort()Description copied from interface:MetadataValueAttempts to convert the value of this metadata item into a short.- Specified by:
- asShortin interface- MetadataValue
- Returns:
- the value as a short.
 
- 
asBytepublic byte asByte()Description copied from interface:MetadataValueAttempts to convert the value of this metadata item into a byte.- Specified by:
- asBytein interface- MetadataValue
- Returns:
- the value as a byte.
 
- 
asBooleanpublic boolean asBoolean()Description copied from interface:MetadataValueAttempts to convert the value of this metadata item into a boolean.- Specified by:
- asBooleanin interface- MetadataValue
- Returns:
- the value as a boolean.
 
- 
asStringDescription copied from interface:MetadataValueAttempts to convert the value of this metadata item into a string.- Specified by:
- asStringin interface- MetadataValue
- Returns:
- the value as a string.
 
 
-