Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Metadatable.java
1 package org.bukkit.metadata;
2 
3 import org.bukkit.plugin.Plugin;
4 
5 import java.util.List;
6 
7 /**
8  * This interface is implemented by all objects that can provide metadata
9  * about themselves.
10  */
11 public interface Metadatable {
12  /**
13  * Sets a metadata value in the implementing object's metadata store.
14  *
15  * @param metadataKey A unique key to identify this metadata.
16  * @param newMetadataValue The metadata value to apply.
17  * @throws IllegalArgumentException If value is null, or the owning plugin
18  * is null
19  */
20  public void setMetadata(String metadataKey, MetadataValue newMetadataValue);
21 
22  /**
23  * Returns a list of previously set metadata values from the implementing
24  * object's metadata store.
25  *
26  * @param metadataKey the unique metadata key being sought.
27  * @return A list of values, one for each plugin that has set the
28  * requested value.
29  */
30  public List<MetadataValue> getMetadata(String metadataKey);
31 
32  /**
33  * Tests to see whether the implementing object contains the given
34  * metadata value in its metadata store.
35  *
36  * @param metadataKey the unique metadata key being queried.
37  * @return the existence of the metadataKey within subject.
38  */
39  public boolean hasMetadata(String metadataKey);
40 
41  /**
42  * Removes the given metadata value from the implementing object's
43  * metadata store.
44  *
45  * @param metadataKey the unique metadata key identifying the metadata to
46  * remove.
47  * @param owningPlugin This plugin's metadata value will be removed. All
48  * other values will be left untouched.
49  * @throws IllegalArgumentException If plugin is null
50  */
51  public void removeMetadata(String metadataKey, Plugin owningPlugin);
52 }
void setMetadata(String metadataKey, MetadataValue newMetadataValue)
void removeMetadata(String metadataKey, Plugin owningPlugin)
List< MetadataValue > getMetadata(String metadataKey)
boolean hasMetadata(String metadataKey)