Class BanActionData

java.lang.Object
fr.andross.banitem.actions.BanActionData

public final class BanActionData extends Object
This class offers a way to store the ban actions data. Example: the messages, if the action should be logged, any item... The data type is written as description in BanDataType description. I've also included some clear api methods to get them, at the bottom.
Version:
3.1
Author:
Andross
  • Constructor Details

    • BanActionData

      public BanActionData()
  • Method Details

    • getData

      @Nullable public <T> T getData(@NotNull BanDataType type)
      Trying to get the data from this map
      Type Parameters:
      T - the object of the data, retrievable and described in BanDataType
      Parameters:
      type - the type of data
      Returns:
      the data, null if not found or not a valid type
    • contains

      public boolean contains(@Nullable BanData data)
      Trying to check if a data is present in this ban action datas. This is accepted only for Set datas, described in BanDataType
      Parameters:
      data - the ban data to check
      Returns:
      true if the data matches, otherwise false
    • serialize

      @NotNull public Map<String,Object> serialize()
      Serializing the data (to save them into config files)
      Returns:
      a non null serialized map
    • serialize

      @NotNull public List<String> serialize(@NotNull Collection<Object> c)
      This will serialize a collection of object. Mainly used to parse the maps into a config file
      Parameters:
      c - collection of objects
      Returns:
      a list of serialized object from the collection
    • getCooldown

      public long getCooldown()
      Trying to get a cooldown added for this action
      Returns:
      a cooldown long (millis)
    • getEntities

      @Nullable public Set<org.bukkit.entity.EntityType> getEntities()
      Trying to get a set of entitytype added for this action
      Returns:
      the set of entitytype, null if there is none added
    • getEnchantments

      @Nullable public Set<EnchantmentWrapper> getEnchantments()
      Trying to get a set of enchantmentwrapper added for this action
      Returns:
      the set of enchantmentwrapper, null if there is none added
    • getGamemodes

      @Nullable public Set<org.bukkit.GameMode> getGamemodes()
      Trying to get a set of gamemodes added for this action
      Returns:
      the set of gamemodes, null if there is none added
    • getInventoryFrom

      @Nullable public Set<org.bukkit.event.inventory.InventoryType> getInventoryFrom()
      Trying to get a set of inventory-from added for this action
      Returns:
      the set of InventoryType, null if there is none added
    • getInventoryTo

      @Nullable public Set<org.bukkit.event.inventory.InventoryType> getInventoryTo()
      Trying to get a set of inventory-to added for this action
      Returns:
      the set of InventoryType, null if there is none added
    • getMaterial

      @Nullable public Set<org.bukkit.Material> getMaterial()
      Trying to get a set of materials added for this action
      Returns:
      the set of material, null if there is none added
    • getLog

      public boolean getLog()
      Trying to check if the action should be logged
      Returns:
      true if the action is logged, otherwise false
    • getMessages

      @Nullable public List<String> getMessages()
      Trying to get the messages added for this action
      Returns:
      the list of messages, null if there is no messages added
    • getRun

      @Nullable public List<String> getRun()
      Trying to get the commands run for this action
      Returns:
      the list of commands run, null if there is no commands added
    • getCooldowns

      @NotNull public Map<UUID,Long> getCooldowns()
      Returns:
      map containing players cooldowns time
    • getMap

      @NotNull public Map<BanDataType,Object> getMap()
      Get the map
      Returns:
      the map