Class CooldownRepository.MappingCooldownRepository<C,K>
java.lang.Object
org.incendo.cloud.processors.cooldown.CooldownRepository.MappingCooldownRepository<C,K>
- All Implemented Interfaces:
CooldownRepository<C>
- Enclosing interface:
- CooldownRepository<K>
public static final class CooldownRepository.MappingCooldownRepository<C,K>
extends Object
implements CooldownRepository<C>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.processors.cooldown.CooldownRepository
CooldownRepository.AbstractCooldownRepository<K>, CooldownRepository.CacheCooldownRepository<K>, CooldownRepository.MapCooldownRepository<K>, CooldownRepository.MappingCooldownRepository<C,K> -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCooldown(@NonNull C key, @NonNull CooldownGroup group) Deletes the cooldown identified by the givenkeybelonging to the givengroup.voiddeleteProfile(@NonNull C key) Deletes the profile identified by the givenkey.getProfile(@NonNull C key, @NonNull CooldownProfileFactory profileFactory) Returns the profile for the givenkey.getProfileIfExists(@NonNull C key) Returns the profile for the givenkey, if it exists.
-
Method Details
-
getProfile
public @NonNull CooldownProfile getProfile(@NonNull C key, @NonNull CooldownProfileFactory profileFactory) Description copied from interface:CooldownRepositoryReturns the profile for the givenkey.If no profile exists in the repository, a new profile will be persisted and returned.
- Specified by:
getProfilein interfaceCooldownRepository<C>- Parameters:
key- key that identifies the profileprofileFactory- factory that creates profiles- Returns:
- the profile
-
getProfileIfExists
Description copied from interface:CooldownRepositoryReturns the profile for the givenkey, if it exists.- Specified by:
getProfileIfExistsin interfaceCooldownRepository<C>- Parameters:
key- key that identifies the profile- Returns:
- the profile, or
null
-
deleteProfile
Description copied from interface:CooldownRepositoryDeletes the profile identified by the givenkey.- Specified by:
deleteProfilein interfaceCooldownRepository<C>- Parameters:
key- the key
-
deleteCooldown
Description copied from interface:CooldownRepositoryDeletes the cooldown identified by the givenkeybelonging to the givengroup.If the profile is empty after the deletion, then the profile is deleted too.
- Specified by:
deleteCooldownin interfaceCooldownRepository<C>- Parameters:
key- key identifying the profilegroup- group to delete
-