Package org.javacord.api.util.cache
Interface MessageCache
-
public interface MessageCache
This class is used to cache message.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getCapacity()
Gets the capacity of the message cache.int
getStorageTimeInSeconds()
Gets the maximum age of the message in seconds.void
setAutomaticCleanupEnabled(boolean automaticCleanupEnabled)
Sets whether automatic message cache cleanup is enabled.void
setCapacity(int capacity)
Sets the capacity of the message cache.void
setStorageTimeInSeconds(int storageTimeInSeconds)
Sets maximum age of old messages in seconds.
-
-
-
Method Detail
-
getCapacity
int getCapacity()
Gets the capacity of the message cache. Please notice that the cache is cleared only once every minute!- Returns:
- The capacity of the message cache.
-
setCapacity
void setCapacity(int capacity)
Sets the capacity of the message cache. Messages which are cached forever are not included in this limit. Please notice that the cache is cleared only once every minute!- Parameters:
capacity
- The capacity of the message cache.
-
getStorageTimeInSeconds
int getStorageTimeInSeconds()
Gets the maximum age of the message in seconds. Please notice that the cache is cleared only once every minute!- Returns:
- The maximum age of the message in seconds.
-
setStorageTimeInSeconds
void setStorageTimeInSeconds(int storageTimeInSeconds)
Sets maximum age of old messages in seconds. Please notice that the cache is cleared only once every minute!- Parameters:
storageTimeInSeconds
- The maximum age in seconds.
-
setAutomaticCleanupEnabled
void setAutomaticCleanupEnabled(boolean automaticCleanupEnabled)
Sets whether automatic message cache cleanup is enabled.- Parameters:
automaticCleanupEnabled
- Whether automatic message cache cleanup is enabled.
-
-