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> IGuildDataProvider
public class WatameBotDatabase
extends AbstractDatabase
implements IGuildDataProvider, IPropertyProvider<String,net.dv8tion.jda.api.entities.Guild,IGuildPropertyMapping>
-
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(net.dv8tion.jda.api.entities.Guild guild) Register a guild to be loaded during data retrieval.voidclose()getDataForGuild(net.dv8tion.jda.api.entities.Guild guild) NEED_JAVADOCIPropertyField<String,net.dv8tion.jda.api.entities.Guild, IGuildPropertyMapping> getProperty(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.protected voidonReady()voidremoveGuild(net.dv8tion.jda.api.entities.Guild guild) Remove a guild from the data manager.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
public void addGuild(@Nonnull net.dv8tion.jda.api.entities.Guild guild) Register a guild to be loaded during data retrieval.- Parameters:
guild- -Guildto be loaded- Throws:
NullPointerException- ifguildisnull- See Also:
-
removeGuild
public void removeGuild(@Nonnull net.dv8tion.jda.api.entities.Guild guild) Remove a guild from the data manager.- Parameters:
guild- -Guildto be removed- Throws:
NullPointerException- ifguildisnull- See Also:
-
getDataForGuild
Description copied from interface:IGuildDataProviderNEED_JAVADOC- Specified by:
getDataForGuildin interfaceIGuildDataProvider- Returns:
-
getProperty
public IPropertyField<String,net.dv8tion.jda.api.entities.Guild, getPropertyIGuildPropertyMapping> (@Nonnull String key) 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
IPropertyFieldpointing 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
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
onReady
protected void onReady()- Specified by:
onReadyin classAbstractDatabase
-