Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
FixedMetadataValue.java
1 package org.bukkit.metadata;
2 
3 import org.bukkit.plugin.Plugin;
4 
5 import java.util.concurrent.Callable;
6 
7 /**
8  * A FixedMetadataValue is a special case metadata item that contains the same
9  * value forever after initialization. Invalidating a FixedMetadataValue has
10  * no effect.
11  * <p>
12  * This class extends LazyMetadataValue for historical reasons, even though it
13  * overrides all the implementation methods. it is possible that in the future
14  * that the inheritance hierarchy may change.
15  */
16 public class FixedMetadataValue extends LazyMetadataValue {
17 
18  /**
19  * Store the internal value that is represented by this fixed value.
20  */
21  private final Object internalValue;
22 
23  /**
24  * Initializes a FixedMetadataValue with an Object
25  *
26  * @param owningPlugin the {@link Plugin} that created this metadata value
27  * @param value the value assigned to this metadata value
28  */
29  public FixedMetadataValue(Plugin owningPlugin, final Object value) {
30  super(owningPlugin);
31  this.internalValue = value;
32  }
33 
34  @Override
35  public void invalidate() {
36 
37  }
38 
39  @Override
40  public Object value() {
41  return internalValue;
42  }
43 }
FixedMetadataValue(Plugin owningPlugin, final Object value)