Package space.maxus.flare.item
Class ReactiveItemProvider<V>
java.lang.Object
space.maxus.flare.item.ReactiveItemProvider<V>
- Type Parameters:
V- Value type of ReactiveState
- All Implemented Interfaces:
ItemProvider,ReactiveSubscriber<V>
An item provider that depends on value of reactive state
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveItemProvider(org.apache.commons.lang3.concurrent.Computable<@Nullable V, @Nullable org.bukkit.inventory.ItemStack> computable) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanorg.apache.commons.lang3.concurrent.Computable<@Nullable V,@Nullable org.bukkit.inventory.ItemStack> @Nullable org.bukkit.inventory.ItemStackinthashCode()voidonStateChange(V state) Called whenever value inside a reactive state changes@Nullable org.bukkit.inventory.ItemStackprovide()Provides an item stack.voidsetCurrent(@Nullable org.bukkit.inventory.ItemStack current) toString()
-
Constructor Details
-
ReactiveItemProvider
public ReactiveItemProvider(org.apache.commons.lang3.concurrent.Computable<@Nullable V, @Nullable org.bukkit.inventory.ItemStack> computable)
-
-
Method Details
-
provide
@Nullable public @Nullable org.bukkit.inventory.ItemStack provide()Description copied from interface:ItemProviderProvides an item stack.- Specified by:
providein interfaceItemProvider- Returns:
- an ItemStack. May be null
-
onStateChange
Description copied from interface:ReactiveSubscriberCalled whenever value inside a reactive state changes- Specified by:
onStateChangein interfaceReactiveSubscriber<V>- Parameters:
state- The new state value.
-
getComputable
public org.apache.commons.lang3.concurrent.Computable<@Nullable V,@Nullable org.bukkit.inventory.ItemStack> getComputable() -
getCurrent
@Nullable public @Nullable org.bukkit.inventory.ItemStack getCurrent() -
setCurrent
public void setCurrent(@Nullable @Nullable org.bukkit.inventory.ItemStack current) -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-