
org.bukkit.metadata.LazyMetadataValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package org.bukkit.metadata;
import org.apache.commons.lang.Validate;
import org.bukkit.plugin.Plugin;
import java.lang.ref.SoftReference;
import java.util.concurrent.Callable;
/**
* The LazyMetadataValue class implements a type of metadata that is not
* computed until another plugin asks for it.
*
* By making metadata values lazy, no computation is done by the providing
* plugin until absolutely necessary (if ever). Additionally,
* LazyMetadataValue objects cache their values internally unless overridden
* by a {@link CacheStrategy} or invalidated at the individual or plugin
* level. Once invalidated, the LazyMetadataValue will recompute its value
* when asked.
*/
public class LazyMetadataValue extends MetadataValueAdapter implements MetadataValue {
private static final Object ACTUALLY_NULL = new Object();
private Callable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy