Package org.javacord.core.util.cache
Class JavacordEntityCache
- java.lang.Object
-
- org.javacord.core.util.cache.JavacordEntityCache
-
public class JavacordEntityCache extends java.lang.Object
An immutable cache with all Javacord entities.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JavacordEntityCache
empty()
Gets an empty Javacord cache.ChannelCache
getChannelCache()
Gets the channel cache.MemberCache
getMemberCache()
Gets the member cache.UserPresenceCache
getUserPresenceCache()
Gets the user presence cache.JavacordEntityCache
setChannelCache(ChannelCache channelCache)
Sets the channel cache.JavacordEntityCache
setMemberCache(MemberCache memberCache)
Sets the member cache.JavacordEntityCache
setUserPresenceCache(UserPresenceCache userPresenceCache)
Sets the user presence cache.JavacordEntityCache
updateChannelCache(java.util.function.UnaryOperator<ChannelCache> mapper)
Updates the channel cache.JavacordEntityCache
updateMemberCache(java.util.function.UnaryOperator<MemberCache> mapper)
Updates the member cache.JavacordEntityCache
updateUserPresenceCache(java.util.function.UnaryOperator<UserPresenceCache> mapper)
Updates the user presence cache.
-
-
-
Method Detail
-
empty
public static JavacordEntityCache empty()
Gets an empty Javacord cache.- Returns:
- An empty Javacord cache.
-
getChannelCache
public ChannelCache getChannelCache()
Gets the channel cache.- Returns:
- The channel cache.
-
updateChannelCache
public JavacordEntityCache updateChannelCache(java.util.function.UnaryOperator<ChannelCache> mapper)
Updates the channel cache.- Parameters:
mapper
- A function that takes the old channel cache and returns the new one.- Returns:
- The new Javacord entity cache.
-
setChannelCache
public JavacordEntityCache setChannelCache(ChannelCache channelCache)
Sets the channel cache.- Parameters:
channelCache
- The channel cache to set.- Returns:
- The new Javacord entity cache.
-
getMemberCache
public MemberCache getMemberCache()
Gets the member cache.- Returns:
- The member cache.
-
updateMemberCache
public JavacordEntityCache updateMemberCache(java.util.function.UnaryOperator<MemberCache> mapper)
Updates the member cache.- Parameters:
mapper
- A function that takes the old member cache and returns the new one.- Returns:
- The new Javacord entity cache.
-
setMemberCache
public JavacordEntityCache setMemberCache(MemberCache memberCache)
Sets the member cache.- Parameters:
memberCache
- The member cache to set.- Returns:
- The new Javacord entity cache.
-
getUserPresenceCache
public UserPresenceCache getUserPresenceCache()
Gets the user presence cache.- Returns:
- The user presence cache.
-
updateUserPresenceCache
public JavacordEntityCache updateUserPresenceCache(java.util.function.UnaryOperator<UserPresenceCache> mapper)
Updates the user presence cache.- Parameters:
mapper
- A function that takes the old user presence cache and returns the new one.- Returns:
- The new Javacord entity cache.
-
setUserPresenceCache
public JavacordEntityCache setUserPresenceCache(UserPresenceCache userPresenceCache)
Sets the user presence cache.- Parameters:
userPresenceCache
- The user presence cache to set.- Returns:
- The new Javacord entity cache.
-
-