Class CustomToggle
Object
CustomToggle
- All Implemented Interfaces:
AbilityToggle
This custom toggle can be used to customize default abilities supplied by the library. Users can call
toggle(java.lang.String, java.lang.String) to
rename the default abilities or turnOff(java.lang.String) to simply turn off the said ability.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumList of all the properties recognized byCustomToggle. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfig(Properties properties) booleanprocessAbility(Ability ability) Abilities that are ON (and have failed theAbilityToggle.isOff(org.telegram.telegrambots.abilitybots.api.objects.Ability)condition) will be processed by this method.
-
Field Details
-
OFF
- See Also:
-
-
Constructor Details
-
CustomToggle
public CustomToggle()
-
-
Method Details
-
isOff
- Specified by:
isOffin interfaceAbilityToggle- Parameters:
ability- the target ability- Returns:
- true if the ability has been turned off
-
processAbility
Description copied from interface:AbilityToggleAbilities that are ON (and have failed theAbilityToggle.isOff(org.telegram.telegrambots.abilitybots.api.objects.Ability)condition) will be processed by this method.- Specified by:
processAbilityin interfaceAbilityToggle- Parameters:
ability- the target ability- Returns:
- the processed ability
-
toggle
- Parameters:
abilityName- the ability you want to changetargetName- the final name for this ability- Returns:
- the toggle instance
-
turnOff
- Parameters:
ability- the ability name you would like turned off- Returns:
- the toggle instance
-
config
- Parameters:
properties- the abilities toggle definition- Returns:
- the toggle instance
-