Class BanProvider
java.lang.Object
de.murmelmeister.murmelapi.bansystem.ban.BanProvider
- All Implemented Interfaces:
Ban
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidban(int userId, int creatorId, int reasonId, long time) Bans a user for a specified time period.private voidcreateTable(String tableName) getExpiredDate(int userId) Retrieves the expiration date for the ban of the user with the specified ID in a human-readable format.longgetExpiredTime(int userId) Retrieves the expiration time for the ban of the user with the specified ID.getLog()Retrieves the Log instance associated with this Ban system.Retrieves the Reason instance associated with the Ban system.booleanisBanned(int userId) Checks whether a user is currently banned.voidunban(int userId) Unbans a user with the given user ID.
-
Field Details
-
reason
-
log
-
-
Constructor Details
-
BanProvider
public BanProvider()
-
-
Method Details
-
createTable
-
ban
public void ban(int userId, int creatorId, int reasonId, long time) Description copied from interface:BanBans a user for a specified time period. -
unban
public void unban(int userId) Description copied from interface:BanUnbans a user with the given user ID. -
getExpiredTime
public long getExpiredTime(int userId) Description copied from interface:BanRetrieves the expiration time for the ban of the user with the specified ID.- Specified by:
getExpiredTimein interfaceBan- Parameters:
userId- The ID of the user whose ban expiration time is to be retrieved.- Returns:
- The expiration time of the ban in milliseconds since the epoch, or -1 if the user is not banned.
-
getExpiredDate
Description copied from interface:BanRetrieves the expiration date for the ban of the user with the specified ID in a human-readable format.- Specified by:
getExpiredDatein interfaceBan- Parameters:
userId- The ID of the user whose ban expiration date is to be retrieved.- Returns:
- The expiration date of the ban as a string, or "Not Banned" if the user is not banned.
-
isBanned
public boolean isBanned(int userId) Description copied from interface:BanChecks whether a user is currently banned. -
getReason
Description copied from interface:BanRetrieves the Reason instance associated with the Ban system. -
getLog
Description copied from interface:BanRetrieves the Log instance associated with this Ban system.
-