Class CustomToggle
java.lang.Object
org.telegram.abilitybots.api.toggle.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
Modifier and TypeClassDescriptionstatic enum
List of all the properties recognized byCustomToggle
. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconfig
(Properties properties) boolean
processAbility
(Ability ability) Abilities that are ON (and have failed theAbilityToggle.isOff(org.telegram.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:
isOff
in interfaceAbilityToggle
- Parameters:
ability
- the target ability- Returns:
- true if the ability has been turned off
-
processAbility
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:
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
-