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>

public class ReactiveItemProvider<V> extends Object implements ItemProvider, ReactiveSubscriber<V>
An item provider that depends on value of reactive state
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReactiveItemProvider(org.apache.commons.lang3.concurrent.Computable<@Nullable V,@Nullable org.bukkit.inventory.ItemStack> computable)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    org.apache.commons.lang3.concurrent.Computable<@Nullable V,@Nullable org.bukkit.inventory.ItemStack>
     
    @Nullable org.bukkit.inventory.ItemStack
     
    int
     
    void
    Called whenever value inside a reactive state changes
    @Nullable org.bukkit.inventory.ItemStack
    Provides an item stack.
    void
    setCurrent(@Nullable org.bukkit.inventory.ItemStack current)
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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: ItemProvider
      Provides an item stack.
      Specified by:
      provide in interface ItemProvider
      Returns:
      an ItemStack. May be null
    • onStateChange

      public void onStateChange(@Nullable V state)
      Description copied from interface: ReactiveSubscriber
      Called whenever value inside a reactive state changes
      Specified by:
      onStateChange in interface ReactiveSubscriber<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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object