Class DefaultToggle
- java.lang.Object
-
- org.telegram.abilitybots.api.toggle.DefaultToggle
-
- All Implemented Interfaces:
AbilityToggle
public class DefaultToggle extends Object implements AbilityToggle
If the user does not supply a toggle to their constructor, the default toggle will be instantiated. This default toggle allows all the default abilities to be registered.
-
-
Constructor Summary
Constructors Constructor Description DefaultToggle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isOff(Ability ability)
Ability
processAbility(Ability ab)
Abilities that are ON (and have failed theAbilityToggle.isOff(org.telegram.abilitybots.api.objects.Ability)
condition) will be processed by this method.
-
-
-
Method Detail
-
isOff
public boolean isOff(Ability ability)
- Specified by:
isOff
in interfaceAbilityToggle
- Parameters:
ability
- the target ability- Returns:
- true if the ability has been turned off
-
processAbility
public Ability processAbility(Ability ab)
Description copied from interface:AbilityToggle
Abilities that are ON (and have failed theAbilityToggle.isOff(org.telegram.abilitybots.api.objects.Ability)
condition) will be processed by this method.- Specified by:
processAbility
in interfaceAbilityToggle
- Parameters:
ab
- the target ability- Returns:
- the processed ability
-
-