Package discord4j.common.store.impl
Class SelectiveStoreLayout
- java.lang.Object
-
- discord4j.common.store.impl.SelectiveStoreLayout
-
- All Implemented Interfaces:
StoreLayout
@Experimental public class SelectiveStoreLayout extends Object implements StoreLayout
StoreLayoutthat enables caches based on the passed inStoreFlagvalues.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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(EnumSet<StoreFlag> enabledStoreFlags, U delegate)Create a new store layout that can partially enable entity stores depending on passedenabledStoreFlags.DataAccessorgetDataAccessor()Returns aDataAccessorthat defines action handlers for reading data from the store.EnumSet<StoreFlag>getEnabledFlags()Return a set ofStoreFlagvalues to selectively enable store actions.GatewayDataUpdatergetGatewayDataUpdater()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, wait
-
Methods inherited from interface discord4j.common.store.api.layout.StoreLayout
getCustomActionMapper
-
-
-
-
Method Detail
-
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
public DataAccessor getDataAccessor()
Description copied from interface:StoreLayoutReturns aDataAccessorthat defines action handlers for reading data from the store.- Specified by:
getDataAccessorin interfaceStoreLayout- Returns:
- a
DataAccessor
-
getGatewayDataUpdater
public GatewayDataUpdater 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
public EnumSet<StoreFlag> 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
-
-