Class AbstractRequirement<A,B,C>

java.lang.Object
com.pixelmonmod.api.requirement.AbstractRequirement<A,B,C>
Type Parameters:
A - The reforged object
B - the minecraft object
C - the value data type
All Implemented Interfaces:
Requirement<A,B,C>
Direct Known Subclasses:
AbstractBooleanRequirement, AbstractCardRequirement, AbstractIntegerRequirement, AbstractPokemonRequirement, AbstractStatueRequirement, AbstractStringRequirement

public abstract class AbstractRequirement<A,B,C> extends Object implements Requirement<A,B,C>
Basic abstract implementation for specs following the format :
  • Field Details

  • Constructor Details

    • AbstractRequirement

      protected AbstractRequirement(Set<String> keys)
  • Method Details

    • getAliases

      public List<String> getAliases()
      Description copied from interface: Requirement
      The aliases of the requirement that it can match against
      Specified by:
      getAliases in interface Requirement<A,B,C>
      Returns:
      The aliases
    • fits

      public boolean fits(String spec)
      Description copied from interface: Requirement
      Checks if the given fits for this requirement
      Specified by:
      fits in interface Requirement<A,B,C>
      Parameters:
      spec - The parsed spec
      Returns:
      True if this requirement is found in the parameter
    • create

      public ParseAttempt<List<Requirement<A,B,?>>> create(String spec)
      Description copied from interface: Requirement
      Creates a list of requirements from the spec being parsed
      Specified by:
      create in interface Requirement<A,B,C>
      Parameters:
      spec - The spec being parsed
      Returns:
      The new list of requirements
    • create

      protected abstract ParseAttempt<List<Requirement<A,B,?>>> create(String key, String spec)
      Attempts to parse the spec with the key that was found in the spec string
      Parameters:
      key - The key found
      spec - The spec being parsed
      Returns:
      The parse attempt