Class MetaTypeComparator

java.lang.Object
fr.andross.banitem.items.meta.MetaTypeComparator
Direct Known Subclasses:
AdvancedEnchantments, AttributeContains, DisplayNameContains, DisplayNameEquals, DisplayNameEqualsRegex, Durability, EnchantmentContains, EnchantmentEquals, ItemsAdder, LoreContains, LoreContainsRegex, LoreEquals, LoreLineContains, ModeldataEquals, NBTAPI, Potion, Unbreakable

public abstract class MetaTypeComparator extends Object
An abstract meta type comparator.
Version:
3.1
Author:
Andross
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Object
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MetaTypeComparator(Object configurationProperties, Debug debug)
    Represents a meta type which can be used to be compared with an item.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    If the instantiation and the load of the configured properties has been successfully.
    abstract boolean
    matches(@NotNull BannedItem bannedItem)
    Check if the meta type configured matches on the item involved.
    void
    setValid(boolean valid)
    Change the state of validation of this meta type comparator.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • configurationProperties

      protected final Object configurationProperties
  • Constructor Details

    • MetaTypeComparator

      public MetaTypeComparator(Object configurationProperties, Debug debug)
      Represents a meta type which can be used to be compared with an item. Implementer will handle the propertiesConfiguration representing the properties.
      Parameters:
      configurationProperties - the property configuration used
      debug - the debug object
  • Method Details

    • isValid

      public boolean isValid()
      If the instantiation and the load of the configured properties has been successfully.
      Returns:
      true if the properties has correctly been loaded, otherwise false
    • setValid

      public void setValid(boolean valid)
      Change the state of validation of this meta type comparator. If false, the meta type implementation will not be used into the custom item system, to check if an item matches.
      Parameters:
      valid - if the meta type is correctly loaded
    • matches

      public abstract boolean matches(@NotNull @NotNull BannedItem bannedItem)
      Check if the meta type configured matches on the item involved.
      Parameters:
      bannedItem - the current item involved
      Returns:
      true if the meta is present on the item, otherwise false