Package com.pixelmonmod.api.requirement
Class AbstractRecursiveRequirement<A,B>
java.lang.Object
com.pixelmonmod.api.requirement.AbstractRecursiveRequirement<A,B>
- All Implemented Interfaces:
Requirement<A,
B, List<Requirement<A, B, ?>>>
public abstract class AbstractRecursiveRequirement<A,B>
extends Object
implements Requirement<A,B,List<Requirement<A,B,?>>>
The basics for a recursive requirement
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRecursiveRequirement
(Class<? extends Specification<A, B>> clazz, Set<String> keys) protected
AbstractRecursiveRequirement
(Class<? extends Specification<A, B>> clazz, Set<String> keys, List<Requirement<A, B, ?>> requirements) -
Method Summary
Modifier and TypeMethodDescriptionParseAttempt<List<Requirement<A,
B, ?>>> Creates a list of requirements from the spec being parsedboolean
Checks if the given fits for this requirementThe aliases of the requirement that it can match againstint
Gets the order priority of the requirement.List<Requirement<A,
B, ?>> getValue()
Gets the internal value of the requirementboolean
If the spec should continue processing the results after applying this requirement.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pixelmonmod.api.requirement.Requirement
applyData, applyMinecraft, createInstance, isDataMatch, isMinecraftMatch
-
Field Details
-
requirements
-
-
Constructor Details
-
AbstractRecursiveRequirement
-
AbstractRecursiveRequirement
protected AbstractRecursiveRequirement(Class<? extends Specification<A, B>> clazz, Set<String> keys, List<Requirement<A, B, ?>> requirements)
-
-
Method Details
-
getAliases
Description copied from interface:Requirement
The aliases of the requirement that it can match against- Specified by:
getAliases
in interfaceRequirement<A,
B, List<Requirement<A, B, ?>>> - Returns:
- The aliases
-
getPriority
public int getPriority()Description copied from interface:Requirement
Gets the order priority of the requirement. Higher number = higher priority (i.e. it is applied first)- Specified by:
getPriority
in interfaceRequirement<A,
B, List<Requirement<A, B, ?>>> - Returns:
- The priority
-
shouldContinue
public boolean shouldContinue()Description copied from interface:Requirement
If the spec should continue processing the results after applying this requirement.
For example, for a logical AND this would return false as it handles the processing of the remaining requirements- Specified by:
shouldContinue
in interfaceRequirement<A,
B, List<Requirement<A, B, ?>>> - Returns:
- True if it should continue processing
-
fits
Description copied from interface:Requirement
Checks if the given fits for this requirement- Specified by:
fits
in interfaceRequirement<A,
B, List<Requirement<A, B, ?>>> - Parameters:
spec
- The parsed spec- Returns:
- True if this requirement is found in the parameter
-
create
Description copied from interface:Requirement
Creates a list of requirements from the spec being parsed- Specified by:
create
in interfaceRequirement<A,
B, List<Requirement<A, B, ?>>> - Parameters:
spec
- The spec being parsed- Returns:
- The new list of requirements
-
getValue
Description copied from interface:Requirement
Gets the internal value of the requirement- Specified by:
getValue
in interfaceRequirement<A,
B, List<Requirement<A, B, ?>>> - Returns:
- The value stored
-