Package discord4j.common.store.impl
Class SelectiveStoreLayout
java.lang.Object
discord4j.common.store.impl.SelectiveStoreLayout
- All Implemented Interfaces:
StoreLayout
StoreLayout that enables caches based on the passed in StoreFlag values.-
Method Summary
Modifier and TypeMethodDescriptionstatic StoreLayoutcreate(EnumSet<StoreFlag> enabledFlags, DataAccessor dataAccessor, GatewayDataUpdater gatewayDataUpdater) Create a new store layout that can partially enable entity stores depending on passedenabledStoreFlags.static <U extends DataAccessor & GatewayDataUpdater>
StoreLayoutCreate a new store layout that can partially enable entity stores depending on passedenabledStoreFlags.Returns aDataAccessorthat defines action handlers for reading data from the store.Return a set ofStoreFlagvalues to selectively enable store actions.Returns aGatewayDataUpdaterthat defines action handlers for updates received from the Discord gateway.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface discord4j.common.store.api.layout.StoreLayout
getCustomActionMapper
-
Method Details
-
create
public static <U extends DataAccessor & GatewayDataUpdater> StoreLayout create(EnumSet<StoreFlag> enabledStoreFlags, U delegate) Create a new store layout that can partially enable entity stores depending on passedenabledStoreFlags. Refer toStoreFlagvalues to understand each affected store operation.- Parameters:
enabledStoreFlags- a set of values indicating how to partially enable the delegate capabilitiesdelegate- a delegate for store queries and updates
-
create
public static StoreLayout create(EnumSet<StoreFlag> enabledFlags, DataAccessor dataAccessor, GatewayDataUpdater gatewayDataUpdater) Create a new store layout that can partially enable entity stores depending on passedenabledStoreFlags. Refer toStoreFlagvalues to understand affected store operations.- Parameters:
enabledFlags- a set of values indicating how to partially enable the delegate capabilitiesdataAccessor- a delegate for store queriesgatewayDataUpdater- a delegate for store updates
-
getDataAccessor
Description copied from interface:StoreLayoutReturns aDataAccessorthat defines action handlers for reading data from the store.- Specified by:
getDataAccessorin interfaceStoreLayout- Returns:
- a
DataAccessor
-
getGatewayDataUpdater
Description copied from interface:StoreLayoutReturns aGatewayDataUpdaterthat defines action handlers for updates received from the Discord gateway.- Specified by:
getGatewayDataUpdaterin interfaceStoreLayout- Returns:
- a
GatewayDataUpdater
-
getEnabledFlags
Description copied from interface:StoreLayoutReturn a set ofStoreFlagvalues to selectively enable store actions. By default, it returns all values, meaning this layout will enable all available store actions.- Specified by:
getEnabledFlagsin interfaceStoreLayout- Returns:
- a set of flags to partially enable store actions
-