Package org.bukkit.metadata

# Class FixedMetadataValue

java.lang.Object
org.bukkit.metadata.MetadataValueAdapter
org.bukkit.metadata.LazyMetadataValue
org.bukkit.metadata.FixedMetadataValue

All Implemented Interfaces:
  `MetadataValue`

public class FixedMetadataValue extends LazyMetadataValue
A FixedMetadataValue is a special case metadata item that contains the same value forever after initialization. Invalidating a FixedMetadataValue has no effect.

This class extends LazyMetadataValue for historical reasons, even though it overrides all the implementation methods. it is possible that in the future that the inheritance hierarchy may change.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.bukkit.metadata.LazyMetadataValue

`LazyMetadataValue.CacheStrategy`

## Field Summary

### Fields inherited from class org.bukkit.metadata.MetadataValueAdapter

`owningPlugin`

## Constructor Summary

Constructors
Constructor
Description
`FixedMetadataValue(@NotNull Plugin owningPlugin, @Nullable Object value)`
Initializes a FixedMetadataValue with an Object

## Method Summary

Modifier and Type
Method
Description
`void`
`invalidate()`
Invalidates this metadata item, forcing it to recompute when next accessed.
`@Nullable Object`
`value()`
Fetches the value of this metadata item.

### Methods inherited from class org.bukkit.metadata.MetadataValueAdapter

`asBoolean, asByte, asDouble, asFloat, asInt, asLong, asShort, asString, getOwningPlugin`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### FixedMetadataValue

public FixedMetadataValue(@NotNull @NotNull Plugin owningPlugin, @Nullable @Nullable Object value)
Initializes a FixedMetadataValue with an Object

Parameters:
  `owningPlugin` - the `Plugin` that created this metadata value
  `value` - the value assigned to this metadata value

## Method Details

### invalidate

public void invalidate()
Description copied from interface: `MetadataValue`
Invalidates this metadata item, forcing it to recompute when next accessed.

Specified by:
  `invalidate` in interface `MetadataValue`
Overrides:
  `invalidate` in class `LazyMetadataValue`

### value

@Nullable public @Nullable Object value()
Description copied from interface: `MetadataValue`
Fetches the value of this metadata item.

Specified by:
  `value` in interface `MetadataValue`
Overrides:
  `value` in class `LazyMetadataValue`
Returns:
  the metadata value.