Class BaseRequirement<V>
- java.lang.Object
-
- me.hsgamer.bettergui.api.requirement.BaseRequirement<V>
-
- Type Parameters:
V
- the type of the final value
- All Implemented Interfaces:
MenuElement
,Requirement
- Direct Known Subclasses:
ConditionRequirement
,CooldownRequirement
,PermissionRequirement
,TakableRequirement
,VersionRequirement
public abstract class BaseRequirement<V> extends Object implements Requirement
The base requirement
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface me.hsgamer.bettergui.api.requirement.Requirement
Requirement.Result
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseRequirement(RequirementBuilder.Input input)
Create a new requirement
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Requirement.Result
check(UUID uuid)
Check the requirement for the unique idprotected abstract Requirement.Result
checkConverted(UUID uuid, V value)
Check the requirement for the unique id with the converted valueprotected abstract V
convert(Object value, UUID uuid)
Convert the raw value to the final valueV
getFinalValue(UUID uuid)
Get the final valueMenu
getMenu()
Get the menu containing the elementString
getName()
Get the name of the requirementprotected Object
handleValue(Object inputValue)
Get the value from the input value
-
-
-
Constructor Detail
-
BaseRequirement
protected BaseRequirement(RequirementBuilder.Input input)
Create a new requirement- Parameters:
input
- the input
-
-
Method Detail
-
handleValue
protected Object handleValue(Object inputValue)
Get the value from the input value- Parameters:
inputValue
- the input value- Returns:
- the value
-
convert
protected abstract V convert(Object value, UUID uuid)
Convert the raw value to the final value- Parameters:
value
- the raw value- Returns:
- the final value
-
checkConverted
protected abstract Requirement.Result checkConverted(UUID uuid, V value)
Check the requirement for the unique id with the converted value- Parameters:
uuid
- the unique idvalue
- the converted value- Returns:
- the result
-
getFinalValue
public final V getFinalValue(UUID uuid)
Get the final value- Parameters:
uuid
- the unique id- Returns:
- the final value
-
check
public Requirement.Result check(UUID uuid)
Description copied from interface:Requirement
Check the requirement for the unique id- Specified by:
check
in interfaceRequirement
- Parameters:
uuid
- the unique id- Returns:
- the result
-
getMenu
public Menu getMenu()
Description copied from interface:MenuElement
Get the menu containing the element- Specified by:
getMenu
in interfaceMenuElement
- Returns:
- the menu
-
getName
public String getName()
Description copied from interface:Requirement
Get the name of the requirement- Specified by:
getName
in interfaceRequirement
- Returns:
- the name
-
-