java.lang.Object
net.foxgenesis.database.AbstractDatabase
net.foxgenesis.watame.sql.WatameBotDatabase
- All Implemented Interfaces:
AutoCloseable,IPropertyProvider<String,,net.dv8tion.jda.api.entities.Guild, IGuildPropertyMapping> IGuildPropertyProvider,IGuildDataProvider
public class WatameBotDatabase
extends AbstractDatabase
implements IGuildDataProvider, IGuildPropertyProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.foxgenesis.database.AbstractDatabase
AbstractDatabase.SQLConsumer<U>, AbstractDatabase.SQLFunction<U,V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGuild(long id) Register a guild to be loaded during data retrieval.voidaddGuild(net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.voidclose()getDataForGuild(net.dv8tion.jda.api.entities.Guild guild) NEED_JAVADOCgetProperty(String key) Get a property field associated with a specified key.booleanisPropertyPresent(String key) Check if the property associated with the specified key has already been constructed.keySet()Get a set of all registered keys this provider has constructed.protected voidonReady()NEED_JAVADOCvoidremoveGuild(long id) Remove a guild from the data manager.voidremoveGuild(net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class net.foxgenesis.database.AbstractDatabase
getName, getRawStatement, hasStatementID, isReady, mapCallable, mapStatement, openConnection, prepareCallable, prepareCallableAsync, prepareStatement, prepareStatementAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.foxgenesis.watame.sql.IGuildDataProvider
isReady
-
Constructor Details
-
WatameBotDatabase
public WatameBotDatabase()
-
-
Method Details
-
addGuild
@Deprecated(forRemoval=true) public void addGuild(@Nonnull net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.Register a guild to be loaded during data retrieval.- Parameters:
guild- -Guildto be loaded- Throws:
NullPointerException- ifguildisnull- See Also:
-
removeGuild
@Deprecated(forRemoval=true) public void removeGuild(@Nonnull net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.Remove a guild from the data manager.- Parameters:
guild- -Guildto be removed- Throws:
NullPointerException- ifguildisnull- See Also:
-
addGuild
public void addGuild(long id) Register a guild to be loaded during data retrieval.NOTE: This contains a
ForkJoinPool.ManagedBlocker!- Parameters:
id- - guild ID to be removed- Throws:
IllegalArgumentException- ifidis 0- See Also:
-
removeGuild
public void removeGuild(long id) Remove a guild from the data manager.- Parameters:
id- - guild ID to be removed- Throws:
IllegalArgumentException- ifidis 0- See Also:
-
getDataForGuild
Description copied from interface:IGuildDataProviderNEED_JAVADOC- Specified by:
getDataForGuildin interfaceIGuildDataProvider- Returns:
-
getProperty
Description copied from interface:IPropertyProviderGet a property field associated with a specified key.- Specified by:
getPropertyin interfaceIPropertyProvider<String,net.dv8tion.jda.api.entities.Guild, IGuildPropertyMapping> - Parameters:
key- - the property's key- Returns:
- Returns an
ImmutablePropertypointing to the specified key
-
isPropertyPresent
Description copied from interface:IPropertyProviderCheck if the property associated with the specified key has already been constructed.- Specified by:
isPropertyPresentin interfaceIPropertyProvider<String,net.dv8tion.jda.api.entities.Guild, IGuildPropertyMapping> - Parameters:
key- - the property's key- Returns:
- Returns
trueif the property's key has already been registered/constructed.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
onReady
protected void onReady()Description copied from class:AbstractDatabaseNEED_JAVADOC- Specified by:
onReadyin classAbstractDatabase
-
keySet
Description copied from interface:IPropertyProviderGet a set of all registered keys this provider has constructed.- Specified by:
keySetin interfaceIPropertyProvider<String,net.dv8tion.jda.api.entities.Guild, IGuildPropertyMapping> - Returns:
- Returns a
SetofIPropertyProvider
-